Rodenbach 2017-02-08 01:12:49
I have an annotation foo :: (Eq a, Num a, Enum a) => a -> [[Int]] now when I do :t foo I can see it. If I do :t foo 10 I see [[Int]], as expected. But is there a way to get the type of the 10 inside this expression, in ghci? Can I apply the :t somehow to it?
lyxia 2017-02-08 01:16:25
I can't see a straightforward way of knowing how foo is defaulted.
lyxia 2017-02-08 01:18:20
Set MonomorphismRestriction, define x = x where _ = foo x , type :t x
merijn 2017-02-08 01:19:08
You can with a simple local definition
merijn 2017-02-08 01:19:24
Just need to copy asAppliedTo from lambdabot :)
merijn 2017-02-08 01:19:28
:t elem
lambdabot 2017-02-08 01:19:30
(Foldable t, Eq a) => a -> t a -> Bool
merijn 2017-02-08 01:19:38
:t elem `asAppliedTo` 'c'
lambdabot 2017-02-08 01:19:40
Foldable t => Char -> t Char -> Bool
merijn 2017-02-08 01:19:53
That only works for the first argument, but still
merijn 2017-02-08 01:20:13
:t asAppliedTo
lambdabot 2017-02-08 01:20:15
(a -> b) -> a -> a -> b
merijn 2017-02-08 01:20:28
Just copy that type and set "asAppliedTo = const"
karol-cis 2017-02-08 01:37:31
Hey everyone :) I am a student at Imperial College on a gap year. Looking to contribute to a cool project, if anyone needs my help
karol-cis 2017-02-08 01:38:00
Anyone knows where I can look?
dcoutts 2017-02-08 01:38:34
karol-cis: infrastructure is always useful :-) we're always looking for help with cabal & hackage
dcoutts 2017-02-08 01:38:59
ask in #hackage
karol-cis 2017-02-08 01:39:15
Thanks a lot :-)