volhovm 2017-02-02 07:46:55
How is megaparsec better than attoparsec? I heard it _should_ support text better, but in fact all combinators are based on Char. And I can't any convenient combinators to retrieve Text using satisfyMany etc.
jaspervdj 2017-02-02 07:47:23
rule of thumb is that attoparsec is fast, and megaparsec gives better error messages
nitrix 2017-02-02 07:47:29
Ah! I managed to compile gtk on windows!
volhovm 2017-02-02 07:47:42
jaspervdj: oh, alright, that works for me :)
volhovm 2017-02-02 07:48:23
both should work w/o problems with unicode, right?
volhovm 2017-02-02 07:48:59
So i won't be stuck with converting [Word8] into Char manually lol
jaspervdj 2017-02-02 07:50:54
volhovm: I would start of with a `Text` value, and then use that with `Data.Attoparsec.Text` (or megaparsec). That'll do unicode fine
volhovm 2017-02-02 07:51:09
Great, thank you
sm 2017-02-02 08:04:38
half an hour to reinstall 224 packages.. but 12G -> 1.5G
tapirus 2017-02-02 08:20:11
Hi, fairly noob question, I have two lists, a = [1,2,3] and b = [1,2,3,4]
infinity0 2017-02-02 08:20:13
is there a function to convert a StateT s into a StateT t given a Lens s t ?
tapirus 2017-02-02 08:20:51
I'm trying to construct a function f such that f a b gives [2,3,4,5,3,4,5,6,4,5,6,7], i.e. adds each element of a to each element of b and flattens the list
tapirus 2017-02-02 08:21:24
I assume it'll be concatMap ( *something* a) b, but I can't get further than that
drninjabatman 2017-02-02 08:21:27
hello, having a `class C a b c | a -> b` I want to define `instance C a b c => C a b (T c)` but ghc complains that "type 'a' does not determine rhs type 'b'".
lyxia 2017-02-02 08:21:46
infinity0: zoom
drninjabatman 2017-02-02 08:21:54
Can't ghc determine the functional relationship from the constraint?
infinity0 2017-02-02 08:21:59
lyxia: great, thanks!
glguy 2017-02-02 08:22:17
drninjabatman: The error message mentions the extension you can enable to proceed
drninjabatman 2017-02-02 08:22:35
glguy: oh of course! thnx!
Ferdirand 2017-02-02 08:23:36
tapirus: do you know Applicative ?
tapirus 2017-02-02 08:24:40
nope
Ferdirand 2017-02-02 08:25:06
> (+) <$> [1,2,3] <*> [1,2,3,4]
lambdabot 2017-02-02 08:25:09
[2,3,4,5,3,4,5,6,4,5,6,7]
Ferdirand 2017-02-02 08:25:18
alternatively
Boomerang 2017-02-02 08:25:23
> liftA2 (+) [1,2,3] [1,2,3,4]
lambdabot 2017-02-02 08:25:25
[2,3,4,5,3,4,5,6,4,5,6,7]
Ferdirand 2017-02-02 08:25:51
right, that
kadoban 2017-02-02 08:26:59
> do {x <- [1..3]; y <- [1..4]; return $ x + y}
lambdabot 2017-02-02 08:27:02
[2,3,4,5,3,4,5,6,4,5,6,7]
tapirus 2017-02-02 08:28:20
cheers, thanks guys :) reading about Applicative also
Ferdirand 2017-02-02 08:30:01
you can make it work with concatMap too
Ferdirand 2017-02-02 08:30:26
in fact concatMap is (=<<) in the List monad
Ferdirand 2017-02-02 08:30:51
which is why kadoban's version makes sense
recursion-ninja 2017-02-02 08:36:44
When I try and call a C function from Haskell I get a segfault. I put a prinf() statement and a fflush(stdout) as the first instructions of the C function. The printf() output is never rendered to the terminal. I placed a trace statement in the Haskell code right before the FFI call. That trace output is rendered to the terminal. I suspect that there's an error with handing an array from Haskell to C. how do I go abount deb
tsahyt 2017-02-02 08:38:10
recursion-ninja: usually using withArray or a related function
recursion-ninja 2017-02-02 08:39:32
tsahyt: I am using `withArray` to "malloc the arry in Haskell. That's occuring fine as I put more trace statements before and after that call and added strictness annotations to all the IO actions in the `do` block.
tsahyt 2017-02-02 08:39:43
can you post the code somewhere?
tsahyt 2017-02-02 08:39:48
e.g. lpaste
tsahyt 2017-02-02 08:39:54
lpaste.net that is
geekosaur 2017-02-02 08:40:06
possibly gist since the C side likely matters as well, so at least 2 files
lpaste 2017-02-02 08:41:43
recursion-ninja pasted "segfaults all the time" at http://lpaste.net/351998
recursion-ninja 2017-02-02 08:42:34
tsahyt: I posted the Haskell function that calls the FFI binding. It compile's and segfaults so all the types match on the Haskell side of things.
Tuplanolla 2017-02-02 08:43:08
Types don't help much where you're headed, recursion-ninja.
recursion-ninja 2017-02-02 08:43:27
Tuplanolla: Well it's the first step ;)
geekosaur 2017-02-02 08:44:28
is it just me, or is unsafePerformIO + malloc bad juju?
ertes 2017-02-02 08:45:04
recursion-ninja: side note: i'm sure you don't need to force result of 'pure' for 'trace' to work