Search Haskell Channel Logs

Thursday, February 23, 2017

#haskell channel featuring Koterpillar, glguy, lpaste_, robertkennedy, romanandreg, sshine,

romanandreg 2017-02-23 16:08:40
Has anyone tried out stack script functionality? https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#script-interpreter
robertkennedy 2017-02-23 16:08:55
:t \f x y-> [f x, f y]
lambdabot 2017-02-23 16:08:57
(t1 -> t) -> t1 -> t1 -> [t]
romanandreg 2017-02-23 16:08:57
for some reason, my installed version (stack 1.3.2) doesn't have that sub-command
romanandreg 2017-02-23 16:09:13
does anyone have any insight around why?
Koterpillar 2017-02-23 16:09:20
romanandreg: I have, it works, show your script
robertkennedy 2017-02-23 16:10:07
:t (\f x y -> [f x, f y])
lambdabot 2017-02-23 16:10:09
(t1 -> t) -> t1 -> t1 -> [t]
romanandreg 2017-02-23 16:10:43
Koterpillar: I'm doing the example that downloads the turtle package
romanandreg 2017-02-23 16:11:05
and I'm getting this on the terminal: Invalid argument `script'
romanandreg 2017-02-23 16:11:14
Error executing interpreter command: stack script --package turtle -- +RTS -s -RTS ./script.hs
romanandreg 2017-02-23 16:11:57
this is the stack version: Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
Koterpillar 2017-02-23 16:12:05
https://docs.haskellstack.org/en/stable/GUIDE/#script-interpreter
Koterpillar 2017-02-23 16:12:31
see the command there
romanandreg 2017-02-23 16:12:59
ahh
romanandreg 2017-02-23 16:13:06
this is different from the documentation on github
romanandreg 2017-02-23 16:13:08
that makes sense
Koterpillar 2017-02-23 16:13:36
this is the actual documentation site
romanandreg 2017-02-23 16:13:41
ok
romanandreg 2017-02-23 16:13:51
thanks for the heads up
romanandreg 2017-02-23 16:14:01
Hopefully they make the script sub-command
romanandreg 2017-02-23 16:14:08
it looks like it does a lot of stuff by default
MarcelineVQ 2017-02-23 16:14:30
script subcommand?
romanandreg 2017-02-23 16:15:13
MarcelineVQ: https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#stack-configuration-for-scripts
Koterpillar 2017-02-23 16:16:27
I think it was removed in favor of explicit options
robertkennedy 2017-02-23 16:17:31
:t (\f x y -> [f x , f y] :: forall c x y b. ((c x, c y) => (forall a. c a => a -> b) -> x -> y -> [b]))
lambdabot 2017-02-23 16:17:33
error:
lambdabot 2017-02-23 16:17:33
• Could not deduce: (c0 x, c0 y)
lambdabot 2017-02-23 16:17:33
from the context: (c x, c y)
sshine 2017-02-23 16:18:49
@pl \f x y -> (f x, f y)
lambdabot 2017-02-23 16:18:49
flip =<< (((.) . (,)) .)
sshine 2017-02-23 16:19:34
meh.
robertkennedy 2017-02-23 16:20:36
Hmmm.. but I want to end up with `f x ~ f y`
MarcelineVQ 2017-02-23 16:23:45
isn't f x ~ f y already neccesarily true to typecheck [b]
robertkennedy 2017-02-23 16:24:08
Yes, and lambdabot failed to typecheck it
glguy 2017-02-23 16:28:49
robertkennedy: You have the type signature inside the lambda itself (among other issues)
robertkennedy 2017-02-23 16:30:33
glguy: are you saying that wrapping it will solve things?
glguy 2017-02-23 16:30:44
It's saying it *definitely* won't work if you don't :)
robertkennedy 2017-02-23 16:33:42
:t let g f x y = [f x, f y] in g :: forall c x y b. ((c x, c y) => (forall a. c a => a -> b) -> x -> y -> [b])
lambdabot 2017-02-23 16:33:44
error:
lambdabot 2017-02-23 16:33:44
• Could not deduce: (c0 x, c0 y)
lambdabot 2017-02-23 16:33:44
from the context: (c x, c y)
romanandreg 2017-02-23 16:34:18
Koterpillar: do you know how to load the script into ghci using stack?
lpaste_ 2017-02-23 16:34:19
glguy pasted "for robertkennedy" at http://lpaste.net/352927
glguy 2017-02-23 16:34:26
robertkennedy: No, you can't add a rank2 type after the fact
romanandreg 2017-02-23 16:34:32
Koterpillar: the script that is shebanged
glguy 2017-02-23 16:34:34
You have to add that to the definition of 'g' directly
Koterpillar 2017-02-23 16:34:51
romanandreg: stack repl
romanandreg 2017-02-23 16:35:15
magic!
romanandreg 2017-02-23 16:35:19
Koterpillar: thanks
glguy 2017-02-23 16:35:19
robertkennedy: and the type of 'g' is going to be ambiguous when you try to use it, so you have to add the AllowAmbiguousTypes extension
maybefbi 2017-02-23 16:36:42
what does the haskell runtime do?
robertkennedy 2017-02-23 16:36:42
tyvm will try this
halogenandtoast 2017-02-23 16:41:11
back
robertkennedy 2017-02-23 16:43:01
Do you feel like undecidable* and ambiguous* indicate bad practice?