Haskell

jaror,
jaror avatar

I just saw an old commercial and just had to make this:

https://i.imgur.com/FDwtgtQ.jpeg

kosmikus,
@kosmikus@functional.cafe avatar

Well-Typed is releasing the materials for my video-based #Haskell intro course to the public, starting today and continuing over the next few weeks. Initially, parts 1 (Introduction) and 2 (Datatypes and Functions) are available.

https://well-typed.com/intro

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Template Haskell tutorial (last updated 2021)

https://markkarpov.com/tutorial/th

image/png

DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

Some proposals:

Explicit Splice Imports https://github.com/ghc-proposals/ghc-proposals/pull/412

Pure Template Haskell https://github.com/ghc-proposals/ghc-proposals/pull/655

Unicode Syntax for Template Haskell splice https://github.com/ghc-proposals/ghc-proposals/pull/647

Add support for executing TH splices on the host platform during cross compilation. https://gitlab.haskell.org/ghc/ghc/-/issues/24339

Allow splicing Stmt https://gitlab.haskell.org/ghc/ghc/-/issues/24953

Name should be spliceable https://gitlab.haskell.org/ghc/ghc/-/issues/24922

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Another Template Haskell tutorial, also from 2021
https://serokell.io/blog/introduction-to-template-haskell

mangoiv,
@mangoiv@functional.cafe avatar

Behold: cursed non-sense that doesn’t work well but is conceivable to work well with a few more minutes (sorry for not putting them in)

https://bin.mangoiv.com/note?id=95b5b823-05fe-4806-ab40-88c35892936a

mangoiv,
@mangoiv@functional.cafe avatar

I think the only thing that needs to be done is to come up with a clever type class that does some flipping for you, based on the arguments. It’s not entirely trivial but might work.

DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

"A strict binding (with a top level !) should not be thought of as a regular pattern binding that happens to have a bang pattern [...] on the LHS. Rather, the top level ! should be considered part of the let-binding, rather than part of the pattern."

I didn't know about this distinction! Found out about it when fiddling with linear let-bindings in GHC 9.10.1.

https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/strict.html#strict-bindings

https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/linear_types.html#bindings

https://www.reddit.com/r/haskell/comments/1d9kexm/comment/l7i5csk/

mangoiv,
@mangoiv@functional.cafe avatar

this was a lot of fun (named arguments in by using -XOverloadedRecordUpdate)

https://bin.mangoiv.com/note?id=837d3a48-e34e-48e8-b519-8c775f146262

acowley,

Great to see this effort on improving template ! I think that figuring out why people don’t use quotes more is partly answered by the volume of deficiencies already identified. When you find that a quote doesn’t do something you need, it’s not totally uncommon to switch away from them altogether. https://informal.codes/posts/stabilising-th/

tristanC,
@tristanC@functional.cafe avatar
abcdw,
@abcdw@fosstodon.org avatar
tristanC,
@tristanC@functional.cafe avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar
6d03,
@6d03@mathstodon.xyz avatar

Why is there no MonadFail instance for Either String in the prelude?

mangoiv,
@mangoiv@functional.cafe avatar
GZGavinZhao,
@GZGavinZhao@hello.2heng.xin avatar

@mangoiv Hehe, no stickers, but I did order a T-shirt from StickerMule!

mangoiv,
@mangoiv@functional.cafe avatar

@GZGavinZhao tell me how it turns out, i might do the same! <3

mangoiv,
@mangoiv@functional.cafe avatar

Removing the reexports from mtl was, while I really like it conceptually, quite the breaking change, apparently it had become a habit in my team to just import Control.Monad.Except to get access to Control.Monad and Control.Monad.IO.Class… On that note: why’s there no Control.Monad.IO, why do I have to type .Class all the time.

koz,
@koz@chaos.social avatar

Someone who knows and ML: is there a writeup somewhere explaining how first-class modules (a la ML) can do similar things to Haskell type classes? I'm finding it hard to figure that out.

To give a more concrete case: suppose I wanted to write something like Control.Applicative, which provides an 'interface' Applicative with some methods, as well as functions that work for any Applicative. How would I do this with ML-style first-class modules?

jaror,
jaror avatar

@koz I would like to see such a comparison post too. In the meantime I found this stackoverflow question which contains a way to do it using an ML functor: https://stackoverflow.com/questions/48989663/monads-and-sml-modules. The obvious downside is that you have to explicitly state which monad to use at some point.

Another lesser known difference is that I believe you can't instantiate an ML signature with a polymorphic type. For example you can't write an instance of that MAPPABLE signature for a type like Map k v. At least not such that it is still polymorphic over the key type k.

dpwiz,
@dpwiz@qoto.org avatar

@koz Not quite your case, but “The next 500 module systems” paper gives a nice overview of the problem, bridging modules, type classes and records (and scopes!).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • cisconetworking
  • normalnudes
  • tester
  • ngwrru68w68
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines