orion 2017-02-08 12:54:22
Hey. Does anyone know that syntactic sugar for function paramters where the fields of a record can be referenced directly?
orion 2017-02-08 12:54:50
I thought it was Record (..) or something.
EvanR 2017-02-08 12:54:54
you can pattern match on records
glguy 2017-02-08 12:54:56
RecordWildCards
orion 2017-02-08 12:54:59
Yes!
orion 2017-02-08 12:55:08
Thank you.
geekosaur 2017-02-08 12:56:58
and the syntax you are looking for is {..} (braces, not parens)
ertes 2017-02-08 13:17:19
is there a variant of MutVar# for unlifted types? or: what's the cheapest method to store a mutable Int/Int#?
ertes 2017-02-08 13:17:43
+ strict
reactormonk 2017-02-08 13:19:04
Is there a way to say `a` can either be A or B? in an instance definition.
ertes 2017-02-08 13:20:43
reactormonk: nope, but you can either make instances for both A and B, or an instance for Either A B
glguy 2017-02-08 13:20:51
reactormonk: You can make a new typeclass C, and add separate "instance C A" and "instance C B" and then put a "C a" constraint on this instance definition
ertes 2017-02-08 13:21:15
or that
ertes 2017-02-08 13:22:22
reactormonk: what's the use case?
reactormonk 2017-02-08 13:22:24
End result: I wanna derive Data.Data from the class.
ertes 2017-02-08 13:23:10
reactormonk: are you using an API that requires Data? if not, consider using the more modern GHC generics
reactormonk 2017-02-08 13:23:25
ertes, quasiquotes
reactormonk 2017-02-08 13:23:34
I'll also take these, if possible.
reactormonk 2017-02-08 13:24:20
I wanted to use lifting, so I can transfer the compiletime data to runtime data.
reactormonk 2017-02-08 13:32:44
Directly tryint to derive a Lift instance give me the error that there's no Lift ByteString :-/