bwe 2017-02-02 02:46:47
Is there a Haskell Q&A tool similar to stackexchange?
quchen 2017-02-02 02:49:22
bwe: In order of increasing longevity of the question/answer: IRC, Reddit, Stackoverflow.
merijn 2017-02-02 02:49:34
bwe: There are a LOT of high profile haskellers on stackoverflow
quchen 2017-02-02 02:49:54
merijn: »case Just x of _ y -> y«? Nope
merijn 2017-02-02 02:50:03
quchen: Sadly not :\
bennofs 2017-02-02 02:50:44
merijn: can probably do that with ghc generics
merijn 2017-02-02 02:50:58
quchen: I'm extracting a bunch of boilerplate into a function, but that requires me to both construct and pattern match on some values, but I have no way to write that easily
bwe 2017-02-02 02:51:39
quchen, merijn: I rather mean a tool written in Haskell providing a web interface for Q&A like Stackoverflow. Not a platform for asking questions related to Haskell.
quchen 2017-02-02 02:51:41
merijn: I'm sure you can unsafeCoerce something together though :>
bwe 2017-02-02 02:51:53
Sorry for the misunderstanding raised.
merijn 2017-02-02 02:52:02
quchen: Not newtypes, I think :\
merijn 2017-02-02 02:52:13
quchen: The datatypes themselves are from persistent
merijn 2017-02-02 02:52:33
bwe: Not that I know, but I'm not that knowledgable about stuff like that :p
bennofs 2017-02-02 02:52:33
merijn: do they have Generic instances?
quchen 2017-02-02 02:53:20
merijn: isUnary = (case unsafeCoerce x of Just{} -> True; _ = False) `catch` (\Segfault -> Nopenopenope)
merijn 2017-02-02 02:53:56
quchen: No, I need access to the field
merijn 2017-02-02 02:54:02
bennofs: No clue, looking it up now
roxxik 2017-02-02 02:54:21
mbrock: inshell?
merijn 2017-02-02 02:55:26
bennofs: hmmm, I don't know how to find out, tbh :p
merijn 2017-02-02 02:57:39
Pretty sure persistent lets you do what I want, but I'll be damned if I understand how :p
mbrock 2017-02-02 02:59:28
I'm having problems using temporary files and `readProcess`: http://lpaste.net/351972
mbrock 2017-02-02 03:00:18
oops, the problem is already with writing to the temporary file, readProcess is irrelevant
mbrock 2017-02-02 03:01:26
ohh, I have to close the handle if I want to use the file path.
mbrock 2017-02-02 03:02:43
roxxik: running programs within the turtle monad is fine, but I found it curiously hard to extract the result to an IO Text action or similar
mbrock 2017-02-02 03:02:57
roxxik: probably I should figure out how to use the Fold stuff but I'm too lazy
roxxik 2017-02-02 03:03:23
Shell Line -> IO Text?
roxxik 2017-02-02 03:03:24
sek
roxxik 2017-02-02 03:04:43
yah you need folds there
roxxik 2017-02-02 03:05:13
list :: Fold a [a]
roxxik 2017-02-02 03:06:53
\s -> fold list :: Shell a -> [a]
roxxik 2017-02-02 03:06:59
\s -> fold s list :: Shell a -> [a]
mbrock 2017-02-02 03:07:10
thanks!
roxxik 2017-02-02 03:07:21
and then maybe linesToText :: [Line] -> Text
roxxik 2017-02-02 03:08:10
i have to correct:
roxxik 2017-02-02 03:08:14
\s -> fold s list :: Shell a -> IO [a]
roxxik 2017-02-02 03:09:48
you can compose shells and then print it via view, but accessing the output as a text is not a builtin combinator
roxxik 2017-02-02 03:10:42
\s -> linesToText <$> fold s list :: Shell Line -> IO Text -- final version
roxxik 2017-02-02 03:11:47
wait, Fold has a Functor instance ;)
roxxik 2017-02-02 03:12:38
\s -> fold s (linesToText <$> list) :: Shell Line -> IO Text -- really final version, maybe this is better at fusing... jut guessing here