Search Haskell Channel Logs

Monday, February 27, 2017

#haskell channel featuring yezariaely, MarcelineVQ, fragamus, ezyang, Cale, riddle00,

MarcelineVQ 2017-02-27 19:46:03
it's not automatic for README's that end in .md or .markdown and are present in the extra-source-files field?
ezyang 2017-02-27 19:46:24
hmm, maybe I messed up
ezyang 2017-02-27 19:46:26
Oh yes I did
fragamus 2017-02-27 19:55:13
hey ghc -e is a little funky
fragamus 2017-02-27 19:55:59
stack ghc -- -e "putStrLn \"hello\""
fragamus 2017-02-27 19:56:10
that works but
fragamus 2017-02-27 19:56:36
stack ghc -- -e "import Turtle;putStrLn \"hello\""
fragamus 2017-02-27 19:56:41
no workie
fragamus 2017-02-27 19:59:17
nothing multi-line seems to work
fragamus 2017-02-27 19:59:52
I tried a compiler directive followed by a ; and then my putStrLn
fragamus 2017-02-27 20:00:06
anyhow... is there a place to read up on this
MarcelineVQ 2017-02-27 20:00:11
import is a declaration but -e evaluates expressions
fragamus 2017-02-27 20:00:19
ah
MarcelineVQ 2017-02-27 20:00:26
e.g. ghc -e "do putStrLn \"hello\";putStrLn \"foo\""
fragamus 2017-02-27 20:01:16
so it is not going to let me do anything really useful like import a library and THEN evaluate an expression
fragamus 2017-02-27 20:01:33
back to ruby -e
MarcelineVQ 2017-02-27 20:02:38
doesn't seem like it, unless you use a source file in which case ghc -e sourcefile.hs treats it like ghci does
MarcelineVQ 2017-02-27 20:02:42
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using.html#eval-mode
fragamus 2017-02-27 20:04:02
well thank you for this I would have tried in vain
ezyang 2017-02-27 20:06:22
Straw poll: if you see "Could not match somepkg-0.1.0.0:helper:H with ...", what do you think somepkg-0.1.0.0:helper:H refers to?
ezyang 2017-02-27 20:06:46
And is it any clearer if instead it's somepkg:helper-0.1.0.0:H?
MarcelineVQ 2017-02-27 20:08:55
hmm... a stanza named helper in the .cabal file of somepkg that exposes a module called H?
ezyang 2017-02-27 20:09:27
dading!
pavonia 2017-02-27 20:09:44
What is a stanza?
ezyang 2017-02-27 20:09:46
which do you prefer
ezyang 2017-02-27 20:09:53
stuff like test-suite/library/executable
MarcelineVQ 2017-02-27 20:10:07
if that's the case I prefer the first version, to me the relevant info reads more naturally
ezyang 2017-02-27 20:10:17
ok great, that's what I implemented :)
pavonia 2017-02-27 20:11:54
Yeah, the second one then looks confusing, as if different stanzas could have different versions
yezariaely 2017-02-27 20:23:54
Hi there, I try to parse a file that consists of a textual part (ASCII) followed by a binary part.
yezariaely 2017-02-27 20:24:28
I tried parsing it with parsec where I can sucessfully parse the header part (textual). But now I don't know how to proceed with the binary part. Any suggestions?
Cale 2017-02-27 20:25:59
Maybe use Data.Binary.Get?
yezariaely 2017-02-27 20:27:17
ah yeah, that is a good idea. I can read the file using Data.Binary.Get and then extract the header and parse if afterwards. Thanks!
Ptival 2017-02-27 20:29:46
hey #haskell, I wrote this up, let me know what you think! :) https://ptival.github.io/2017/02/25/modular-parser-combinators/
riddle00 2017-02-27 20:41:04
.