Search Haskell Channel Logs

Monday, January 30, 2017

#haskell channel featuring ph88, geekosaur, glguy, Koterpillar, monochrom, ongy,

glguy 2017-01-30 10:45:17
Implement what?
ph88 2017-01-30 10:45:49
eh forget Either .. that was suppose to be (,)
glguy 2017-01-30 10:45:57
What is it you're implementing?
ph88 2017-01-30 10:46:01
https://hackage.haskell.org/package/base-4.9.1.0/docs/GHC-Generics.html#t::-42-:
ph88 2017-01-30 10:46:08
i'm not implementing anything yet :/
glguy 2017-01-30 10:46:26
I know what :*: is, I don't know what aspect of :*: you're worried about
ph88 2017-01-30 10:46:56
that i have two types Foo and Wrapped, where Foo uses Wrapped and i don't know how to implement :*: anymore
glguy 2017-01-30 10:46:59
Perhaps work through some of the links you shared above and get a handle on how things work before you worry about the complexities
glguy 2017-01-30 10:47:23
not knowing what it means to use GHC.Generics is going to make it pretty hard to have concerns about them that make sense
ph88 2017-01-30 10:47:59
what does it mean ?
monochrom 2017-01-30 10:48:57
GHC.Generics is not so easy to understand.
monochrom 2017-01-30 10:49:57
If you have had experience with the "data types a la Carte" paper, then GHC.Generics is more obvious in retrospect. However, "data types a la carte" is not so easy to understand either, I'm just shoving the problem elsewhere.
monochrom 2017-01-30 10:50:42
And yet, GHC.Generics is actually your best bet for "auto-writing code for pretty printing". Such is the fate of going down a rabbit hole.
ph88 2017-01-30 10:51:07
oh funny i just had dinner with that guy the other day
ph88 2017-01-30 10:52:00
and it wasn't a la carte lol
ph88 2017-01-30 10:55:57
ok this is something actually http://www.stephendiehl.com/posts/generics.html it shows type used by other type. Pie uses Filling and Topping so i will take a look at this
ph88 2017-01-30 10:56:33
i must say GHC.Generics makes me quite hungry
ph88 2017-01-30 10:56:40
maybe this was about food all along
melissa_ 2017-01-30 11:01:40
Hey everyone WHYBW?
ph88 2017-01-30 11:01:46
"Since we're passing around a proxy we'll have to manually thread the dictionary around sometimes by passing an undefined cast to the type of the instance we need to resolve." .. this sounds rather complicated
ph88 2017-01-30 11:05:14
menu (undefined :: Pie) <-- srsly
ph88 2017-01-30 11:05:34
try ordering that at your favourite restaurant
ph88 2017-01-30 11:11:18
what kind of construct is that were you can give a type to undefined ..
ph88 2017-01-30 11:11:36
is that like a pointer cast in C ?
ongy 2017-01-30 11:12:53
afaik: undefined is bottom, and all types have bottom as inhabitant (with exception to unboxed stuff)
geekosaur 2017-01-30 11:13:16
it's just specialization to a type
ph88 2017-01-30 11:15:56
is bottom a theoretical thing or is it encoded in a certain way in memory ?
geekosaur 2017-01-30 11:16:33
it's theoretical (nontermination, by whatever means)
geekosaur 2017-01-30 11:17:10
in ghc, undefined = error "Undefined" and error throws an ErrorCall exception
ph88 2017-01-30 11:17:49
does that mean you redefine undefined in that place when you force it to a certain type ?
geekosaur 2017-01-30 11:18:00
but (let x = x in x) is also a form of bottom, one that does not reliably throw an exception
glguy 2017-01-30 11:18:12
ph88: It's no different than using 'map' at a particular type
geekosaur 2017-01-30 11:18:17
no, you are just specializing the type. types only exist at compile time
ph88 2017-01-30 11:18:45
why is that allowed to type check ?
Koterpillar 2017-01-30 11:18:57
:t undefined
lambdabot 2017-01-30 11:18:59
a
geekosaur 2017-01-30 11:19:00
it's a memo to the typechecker to treat an expression that has some more general type as if it had a compatible but more specific type
geekosaur 2017-01-30 11:19:18
why is `1` allowed to typecheck as Int or as Double?
ph88 2017-01-30 11:19:23
aaah i see
geekosaur 2017-01-30 11:19:55
(I should probably say `fromInteger (1 :: Integer)` there, sin ce Num is not part of this)
ph88 2017-01-30 11:20:16
i get the point ^^
ph88 2017-01-30 11:20:24
what's the head of a typeclass instance ?
ph88 2017-01-30 11:21:18
"All of which have a free parameter p which is bound to the head of typeclass instance when used in the associated datatype Rep a."
geekosaur 2017-01-30 11:22:59
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#instance-declarations
ph88 2017-01-30 11:23:26
oki
ph88 2017-01-30 11:24:00
ah i see, interesting terminology o___O