Search Haskell Channel Logs

Sunday, February 26, 2017

#haskell channel featuring hpc, AWizzArd, monochrom, stevenxl, mauke, lambdabot, and 14 others.

srhb 2017-02-26 08:46:45
stevenxl: Classes and modules too.
srhb 2017-02-26 08:46:52
stevenxl: Probably others I've forgotten.
stevenxl 2017-02-26 08:47:08
srhb: OK. Then I need to revisit the rules, because I'm obviously very wrong here. heheh
stevenxl 2017-02-26 08:47:11
thank you both
Rembane 2017-02-26 08:48:17
stevenxl: No worries, good luck!
stevenxl 2017-02-26 08:48:51
Rembane: thank you. this is my 2nd (or 1.5?) time trying to learn Haskell. ;-)
Rembane 2017-02-26 08:49:51
stevenxl: Good stuff! :D
monochrom 2017-02-26 08:52:20
Ticketing can kill people if the ticket machine shoots out a tough sharp ticket at high speed at people :)
epsilonhalbe 2017-02-26 08:52:20
monochrom: that sounds like the next transformers movie
epsilonhalbe 2017-02-26 08:52:20
(or ghostbusters)
Starfflame 2017-02-26 08:55:23
mfw I get my function to compile but it produces a bad output :V
epsilonhalbe 2017-02-26 08:55:35
does anybody know - can I somehow get case insensitive routes in servant, i had a look at GHC.TypeLits - which has no CaseInsensitive symbols, and I didn't find anything useful in servant-server
schell 2017-02-26 08:58:33
hi all o/
kubunto 2017-02-26 08:59:23
jw is there a datatype in haskell that has the ability to be either[T1, T2]
schell 2017-02-26 08:59:45
i'm encountering a <> exception when running a compiled program, but not when i run the same with ghci
schell 2017-02-26 08:59:58
anyone ever run into this?
hpc 2017-02-26 09:00:02
compile it with -threaded
schell 2017-02-26 09:00:42
hmm, it should be
bennofs1 2017-02-26 09:00:54
schell: <> exceptions are not guarranteed, they might happen or not so you cannot rely on them
epsilonhalbe 2017-02-26 09:01:11
kubunto: my first guess would be something buffering related (maybe)
schell 2017-02-26 09:01:47
hpc: i'm compiling with -threaded in my cabal file, though i'm using stack, maybe it's not respecting it?
kubunto 2017-02-26 09:01:48
epsilonhalbe: is there logical disjunction in haskell
schell 2017-02-26 09:02:00
bennofs1: bummer! this has been really hard to debug
nshepperd_ 2017-02-26 09:02:15
kubunto: Either
hpc 2017-02-26 09:02:30
basically what happens is when a thunk is being evaluated, it gets mutated to a black hole
hpc 2017-02-26 09:02:38
which is a thunk that points to code that prints <> and exits
hpc 2017-02-26 09:02:53
then when it's done the thunk is written back
bennofs1 2017-02-26 09:02:55
schell: there's definitely some non-terminating programs that don't causew <>. If the program does terminate or make progress in GHCi, then that's a different story
epsilonhalbe 2017-02-26 09:03:07
my comment was => schell - sorry confused
hpc 2017-02-26 09:03:07
if a thunk's evaluation loops back into itself, it hits that code
hpc 2017-02-26 09:03:19
in the threaded runtime, the black hole is instead a grey hole
kubunto 2017-02-26 09:03:19
nshepperd_: how do you make one
hpc 2017-02-26 09:03:33
the code it is rewritten to is a wait for the previous evaluation to finish
nshepperd_ 2017-02-26 09:03:53
kubunto: data Either a b = Left a | Right b
hpc 2017-02-26 09:04:35
so yeah, something is somehow not respecting that it should be built with the threaded rts
kubunto 2017-02-26 09:04:52
nshepperd_: what do i do after that
nshepperd_ 2017-02-26 09:05:26
kubunto: this type is already in prelude. The constructors are Left and Right
schell 2017-02-26 09:05:35
hpc: well - i am using async, but oddly enough, that's not the code that causes the loop
nshepperd_ 2017-02-26 09:05:40
:t Left "a string"
lambdabot 2017-02-26 09:05:43
Either [Char] b
schell 2017-02-26 09:07:58
to make matters a bit more complicated i have a fairly intricate main loop that includes Eff (freer) using multiple coroutines
kubunto 2017-02-26 09:08:05
i am probably not the first to say this but the similarities between haskell and scala are imense
Welkin 2017-02-26 09:10:54
scala is java in shabby ML clothing
schell 2017-02-26 09:10:57
hpc, epsilonhalbe, bennofs1: https://github.com/schell/odin/blob/engine-loop/app/MapMaker.hs#L180 is the line i've tracked it down to, though that doesn't make sense to me since the computation `slotColorPicture` is used in other spots successfully, and `tilesetOutlinePic` simple runs `return ()`
Welkin 2017-02-26 09:11:24
kubunto: look beyond the syntactic similarities, and they are nothing alike at all
Starfflame 2017-02-26 09:11:50
I have a love-hate relationship with haskell
Starfflame 2017-02-26 09:12:00
I hate it when I can't figure out how to make a function but once I do I love it
Welkin 2017-02-26 09:12:04
Starfflame: you just started using it o.o
Welkin 2017-02-26 09:12:09
it takes time
Welkin 2017-02-26 09:12:16
a couple months at least
kubunto 2017-02-26 09:12:21
Welkin: the thinking behind writing it is not that different to me
schell 2017-02-26 09:12:27
my next thought is that it has something to do with the way `freer`'s effect handlers are unwrapping the main computation and that it somehow can't find a handler
schell 2017-02-26 09:12:47
but i'm going to try a big clean and force recomp to make sure it's not the -threaded issue
Starfflame 2017-02-26 09:14:11
i feel kind of bad for writing this function this way though
Starfflame 2017-02-26 09:14:16
it looks really imperative
kubunto 2017-02-26 09:15:49
Welkin: i also recognize that the languages have different aims, scala isnt trying to be as monadic as haskell is
schell 2017-02-26 09:16:40
bennofs1: btw, my program runs as expected with ghci, as well as with halive, which is a bit like ghci + live recompiling
stevenxl 2017-02-26 09:19:14
hmmm..... it's just dawning on me how similar types in Haskell are to Structs in Elixir. (With the huge, huge caveat that Elixir doesn't enforce consistency through static typing). They are both boxes (structured data) and we can pattern match on their label - i.e., the data construct in Haskell or the struct's name in Elixir.
stevenxl 2017-02-26 09:20:02
err, by type i meant data constructor.
Welkin 2017-02-26 09:20:35
you are simply describing the fact that it has a type system
Welkin 2017-02-26 09:20:47
C structs are similar in that way to haskell data types
stevenxl 2017-02-26 09:20:52
Yea.
stevenxl 2017-02-26 09:21:45
That is right. (Well, not familiar with C, but the previous comment yes.
mettekou 2017-02-26 09:22:57
Is there any evidence of a backdoor in the RDRAND instruction? I'm asking to see if I should disable the flag which enables it when building cryptonite.
kubunto 2017-02-26 09:23:28
Welkin: is it the type system that allows haskell to be so functional?
mettekou 2017-02-26 09:24:05
kubunto: Not really, you could do everything within IO and the type system would let you get away with it.
Welkin 2017-02-26 09:26:02
there is no real definition of "functional"
schell 2017-02-26 09:26:12
yeah, it's a pretty loose term
mettekou 2017-02-26 09:26:38
Welkin schell: Sure there is, referential transparency.
kubunto 2017-02-26 09:26:40
Welkin: then the ability to have functions so easily manipulated
Welkin 2017-02-26 09:26:54
what haskell does give you is: referential transparanency, and immutable data by default, (and lazy evaluation by default)
Welkin 2017-02-26 09:27:04
transparency*
mauke 2017-02-26 09:27:22
lambda calculus has no type system
Welkin 2017-02-26 09:27:35
and everything is automatically curried
mettekou 2017-02-26 09:28:01
mauke: Depends on which lambda calculus you consider. It was originally untyped, but now it's equipped with a type system most of the time.
schell 2017-02-26 09:30:01
i'm not arguing with that, but "functional" is loose enough that we require extra qualifiers to distinguish different kinds of "functional" - "purely functional", "statically typed, functional"
schell 2017-02-26 09:31:25
lisp, javascript, and smalltalk even, can be "functional" if you relegate yourself to certain patterns
MarcelineVQ 2017-02-26 09:31:32
'functions are guranteed citizenship'
schell 2017-02-26 09:31:32
they're not referentially transparent, though
nshepperd 2017-02-26 09:31:58
haskell also has syntax and a type system that lets you do things functionally without breaking down in tears :)
schell 2017-02-26 09:32:04
they're ^ meaning those other langs
mauke 2017-02-26 09:32:22
did someone say template metaprogramming?
schell 2017-02-26 09:32:35
yes - you can force a shoe on your head but that does'nt make it a great hat
schell 2017-02-26 09:32:57
good entertainment though, that's for sure
Welkin 2017-02-26 09:37:24
schell: but germans already use handshoes!
ongy 2017-02-26 09:40:30
that's cause German words make sense. gloves are clearly 'type Glove = Shoe Hand'
Starfflame 2017-02-26 09:43:56
lol
Starfflame 2017-02-26 09:44:11
i love the german language
AWizzArd 2017-02-26 09:44:21
Why?
Starfflame 2017-02-26 09:44:39
because it's relatively pure
Starfflame 2017-02-26 09:44:45
and uses compound words which I like
AWizzArd 2017-02-26 09:44:55
Isn't english roughly 50% a germanic language itself?
mounty 2017-02-26 09:45:07
Starfflame: if you want a pure language from that group: Icelandic.