Search Haskell Channel Logs

Monday, January 30, 2017

#haskell channel featuring halogenandtoast, qmm, nshepperd, mrkgnao, monochrom, Axman6,

lpaste 2017-01-30 18:29:15
qmm pasted "monochrom: this seems to work in ghci" at http://lpaste.net/351813
halogenandtoast 2017-01-30 18:30:05
Axman6: I might just be bad at googling, trying now
monochrom 2017-01-30 18:30:07
ghci exhibits modified behaviours for convenience.
qmm 2017-01-30 18:30:33
monochrom: okay, thank you
monochrom 2017-01-30 18:31:00
More specifically for this case, when entered into ghci, t retains its most polymorphic type, "Num a => a". (Enter ":type t" to see.)
monochrom 2017-01-30 18:31:27
But this doesn't happen in compiler mode, which is faithful to Haskell 2010.
monochrom 2017-01-30 18:32:00
Haskell 2010 requires the monomorphism restriction for t.
monochrom 2017-01-30 18:32:43
(And that's only half of the story. The other half is that Haskell 2010 also requires defaulting of types.)
monochrom 2017-01-30 18:33:03
(of certain types)
halogenandtoast 2017-01-30 18:33:03
Axman6: it doesn't seem like an instance already exists, but I might be able to reuse what was done here: https://github.com/periodic/LoLLogs/blob/master/parser/Data/GameLog/PersistTH.hs
mrkgnao 2017-01-30 18:36:10
could someone who knows about these things tell me what allowing types like [forall a. a] would do?
mrkgnao 2017-01-30 18:36:34
would that be the type of a heterogeneous list?
monochrom 2017-01-30 18:36:40
No.
lpaste 2017-01-30 18:37:02
qmm pasted "sorry to keep posting in this channel hacking around the problem, this is the error i'm receiving" at http://lpaste.net/351814
monochrom 2017-01-30 18:37:07
[forall a. Num a => a -> a -> a] would be a nice list of polymorphic arithmetic 2ary functions.
nshepperd 2017-01-30 18:37:19
[forall a. a] would be the type of a list of ⊥s
monochrom 2017-01-30 18:39:01
Maybe (forall r. (Int -> r) -> r) would be a nice way to say "I may have a continuation for you"
geekosaur 2017-01-30 18:39:59
qmm, there's nothing obvious wrong with the snippet the error message shows; would have to see the full code
Axman6 2017-01-30 18:42:14
halogenandtoast: have you seen https://hackage.haskell.org/package/persistent-2.6/docs/Database-Persist-Class.html#g:9 ?
Axman6 2017-01-30 18:42:41
hmm, might not be relevant actually
monochrom 2017-01-30 18:43:59
(forall a. a -> IO a, forall a b. IO a -> (a -> IO b) -> IO b) would be a nice dictionary for monad methods.