Search Haskell Channel Logs

Friday, January 27, 2017

#haskell channel featuring schoppenhauer, lambdabot, orzo, hinthint, geekosaur, NemesisD,

NemesisD 2017-01-27 13:46:00
weird...
monochrom 2017-01-27 13:46:13
The type error disappeared? :)
NemesisD 2017-01-27 13:46:16
i can't paste it, this is deep in a large proprietary project. i guess ill keep poking at it
monochrom 2017-01-27 13:47:07
You can apply the subtraction method. Delete code and still keep the type error.
NemesisD 2017-01-27 13:49:28
always this sort of maddening thing happens late on a friday
monochrom 2017-01-27 13:50:16
This is why theoretical physicists avoid work on Fridays altogether.
NemesisD 2017-01-27 13:52:06
genius
orzo 2017-01-27 13:53:50
GADTs seems to enable RankNTypes syntax-wise anyway
monochrom 2017-01-27 13:55:53
Not directly.
monochrom 2017-01-27 13:56:25
It won't accept "f :: (forall a. a -> a) -> ...". You will have to hide that in a GADT.
orzo 2017-01-27 13:57:53
Why do you need an explicit forall to use ScopedTypeVariables on functions?
monochrom 2017-01-27 13:58:13
To increase compatibility with Haskell 2010.
hpc 2017-01-27 13:58:20
how else are you going to quantify them?
orzo 2017-01-27 13:58:28
implicitly of course
hpc 2017-01-27 13:58:29
:t show
lambdabot 2017-01-27 13:58:30
Show a => a -> String
hpc 2017-01-27 13:59:05
hmm, bad example
hinthint 2017-01-27 14:00:19
I'm trying to get the type of a function in Haskell code using hint, but apparently I'm not using the typeOf function right: http://lpaste.net/351724
hinthint 2017-01-27 14:00:40
err, more specifically: http://lpaste.net/351724#line42
orzo 2017-01-27 14:01:14
:t typeOf
lambdabot 2017-01-27 14:01:15
Typeable a => a -> TypeRep
monochrom 2017-01-27 14:01:24
haha your nick hinthint
geekosaur 2017-01-27 14:01:25
typeOf (and Data.Typeable in general) does not currently work with polymorphic types
monochrom 2017-01-27 14:01:50
Unrelated typeOf
geekosaur 2017-01-27 14:02:10
ah
orzo 2017-01-27 14:02:20
isn't his error that he is treating typeOf as if it returns (Interpreter TypeRep)
monochrom 2017-01-27 14:02:33
I don't know the answer, but I sure want to know the current output.
geekosaur 2017-01-27 14:03:12
orzo, as monochrom said, wrong typeRep
geekosaur 2017-01-27 14:03:14
er, typeOf
geekosaur 2017-01-27 14:03:23
http://hackage.haskell.org/package/hint-0.6.0/docs/Language-Haskell-Interpreter.html#v:typeOf
orzo 2017-01-27 14:03:23
o
geekosaur 2017-01-27 14:03:53
it'd producing MonadInterpreter m => m String
hinthint 2017-01-27 14:04:42
geekosaur is correct
hinthint 2017-01-27 14:05:03
monochrom: ; )
monochrom 2017-01-27 14:06:34
@type let {f = head; g = f [f]} in g
lambdabot 2017-01-27 14:06:36
[a] -> a
monochrom 2017-01-27 14:06:59
What output did you get?
schoppenhauer 2017-01-27 14:07:23
hi. is there a codewalker for template haskell? that is, a thingy which I can pass a haskell source code and it will give me the AST such that I can manipulate it?
orzo 2017-01-27 14:09:02
haskell-src-exts ?
schoppenhauer 2017-01-27 14:09:27
orzo: thank you!
orzo 2017-01-27 14:09:50
actually, you said template haskell
orzo 2017-01-27 14:10:17
template haskell has it's own syntax tree type and you can make it using [| |] quotes
schoppenhauer 2017-01-27 14:10:51
yes, but I want to parse some given code, and return a manipulated version of it (for fun and profit)
schoppenhauer 2017-01-27 14:11:26
not sure whether I can pattern match on quotes
orzo 2017-01-27 14:11:27
well i don't think the src-exts parse is type-compatible with template haskell
schoppenhauer 2017-01-27 14:12:01
if I have some expression in quotes inside template haskell, will I get its AST?
orzo 2017-01-27 14:12:28
the [| |] quotes evaluate to an AST
geekosaur 2017-01-27 14:12:31
http://hackage.haskell.org/package/haskell-src-meta
geekosaur 2017-01-27 14:12:48
generates TH AST instead of h-s-e's own AST
schoppenhauer 2017-01-27 14:16:18
orzo: ok, so [| … |] basically parses the haskell code … and gives me the TH AST, right?
orzo 2017-01-27 14:16:36
yes
schoppenhauer 2017-01-27 14:16:52
orzo: thank you.