<    March 2017    >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 _2_4 25  
26 27 28 29 30 31
00:09 t0by joined
00:10 <benzrf> freeside: it helps to put in constraints :)
00:10 <benzrf> check this out http://hoogle.haskell.org/?hoogle=Monad+m+%3D%3E+t+%28m+a%29+-%3E+m+%28t+a%29&scope=set%3Astackage
00:17 <freeside> groovy.
00:22 takle joined
00:27 <benzrf> no, haskell!
00:29 <parsnip> any idea how to make sure type is emitted when entering a single function in interactive mode in haskell mode in emacs?
00:29 <parsnip> http://sprunge.us/QhVS?hs
00:32 NeverDie joined
00:37 takle joined
00:37 eacameron joined
00:44 takle joined
00:48 eacameron joined
00:51 Levex joined
00:52 takle joined
00:54 Gurkenglas_ joined
01:01 Jackoe joined
01:02 patbecich joined
01:05 grayjoc joined
01:05 Jackoe joined
01:17 Jackoe joined
01:17 tom7942 joined
01:40 tom7942 joined
01:42 \Mike joined
01:44 conal joined
01:44 takle joined
01:51 takle joined
01:54 patbecich joined
02:08 takle joined
02:28 aarvar joined
02:33 uglyfigurine joined
02:51 takle joined
03:08 takle joined
03:12 Jackoe joined
03:14 systemfault joined
03:25 takle joined
03:31 conal joined
03:31 dni- joined
03:34 tom7942 joined
03:36 benley joined
03:40 systemfault joined
03:40 mengu joined
03:40 exferenceBot joined
03:40 splanch joined
03:41 systemfault joined
03:41 hphuoc25 joined
03:45 hexagoxel joined
03:57 uglyfigurine joined
03:58 ploop joined
04:02 hphuoc25 joined
04:08 takle joined
04:14 baldfat_ joined
04:15 harfangk joined
04:33 takle joined
04:38 splanch joined
04:40 hphuoc25 joined
04:48 geppettodivacin joined
04:52 hexagoxel joined
04:52 splanch joined
04:54 takle joined
04:59 conal joined
04:59 eacameron joined
05:13 splanch joined
05:17 hphuoc25 joined
05:20 dni- joined
05:26 chadrs joined
05:31 takle joined
05:38 geppettodivacin joined
05:48 uglyfigurine joined
05:48 Rizy joined
05:49 raduom joined
05:56 qu1j0t3 joined
06:06 xmonader joined
06:06 _cyril__ joined
06:07 xmonader joined
06:07 xmonader joined
06:09 xmonader joined
06:12 systemfault joined
06:13 92AAAQ4C5 joined
06:13 Zialus joined
06:14 xmonader joined
06:15 xmonader joined
06:15 takle joined
06:16 systemfault joined
06:18 xmonader joined
06:28 Jackoe joined
06:30 hexagoxel joined
06:32 takle joined
06:34 meandi_2 joined
06:38 splanch joined
06:48 parmagreen joined
06:48 Jackoe joined
06:50 splanch joined
07:00 splanch joined
07:02 simony joined
07:02 simony joined
07:02 suls joined
07:03 hphuoc25 joined
07:04 benzrf joined
07:04 sns joined
07:04 anoe joined
07:04 RouxTheDay joined
07:04 abh joined
07:04 Zialus joined
07:05 hecliunyx joined
07:10 dni- joined
07:10 splanch joined
07:11 tmciver joined
07:11 Rizy joined
07:16 suls joined
07:20 takle joined
07:23 hphuoc25 joined
07:29 takle joined
07:32 hphuoc25 joined
07:38 takle joined
07:41 Jackoe joined
07:41 hphuoc25 joined
07:41 hdeshev joined
07:45 kritzcreek_ joined
07:49 louispan joined
07:58 grayjoc joined
08:04 patbecich joined
08:07 nomotif joined
08:08 takle joined
08:14 <Geekingfrog> Is there a way to test for a type constructor in an if/when statement instead of pattern matching?
08:14 patbecich joined
08:15 takle joined
08:16 <MarcelineVQ> You could call a function that does the pattern matching. if isJust x then ... else ... but in that particular case maybe can be nicer
08:17 <MarcelineVQ> constructors and pattern matching are the heart of haskell so it'll keep coming back to that one way or another
08:18 xkb_ joined
08:19 <Geekingfrog> I ended up doing something like isFOO (Foo _) = True; isFOO _ = False. In this case I exceptionally need to perform one additional action. First time I need that though.
08:19 NoCreativity joined
08:20 mattyw joined
08:21 splanch joined
08:21 dni- joined
08:22 <jle`> Geekingfrog: usually it's preferabble to restructure your program so that you branch on a pattern match instead of a bool
08:22 <jle`> Geekingfrog: Bool's are sort of informational bottlenecks, and are often the source of a lot of bugs
08:24 <jle`> if you find yourself in a situation where you are required to go through Bool, it's usually a sign of some faulty design
08:26 Gloomy joined
08:26 yellowj joined
08:27 <Geekingfrog> jle`: how would you restructure something like that: http://lpaste.net/353844 ?
08:28 hphuoc25 joined
08:28 <Geekingfrog> The case x of Foo -> do... _ -> pure () looks like a code smell to me.
08:28 <jle`> it's probably better than case isFoo x of True -> ...
08:28 <jle`> or when (isFoo x) ...
08:29 <MarcelineVQ> maybe it's not neccesary at all, what does your actual code look like?
08:29 <jle`> because you can verify exactly what's going on
08:29 zero_byte joined
08:29 thc202 joined
08:30 t0by joined
08:30 t0by joined
08:30 <jle`> although i admit 'when' is appealing
08:30 <Geekingfrog> The actual code looks almost like that. I have various successful resolution for a computation, and this function logs something human readable in each case. In one case, I need to perform an additional check before printing something.
08:32 <jle`> alternatively you can factor out the stuff that is done regardless of success tpye
08:32 <jle`> and do case CustomSuccess Foo -> do
08:32 <jle`> common stuff
08:32 <jle`> more stuff
08:32 <jle`> case CustomSuccess _ ->
08:32 <jle`> common stuff
08:32 merijn joined
08:33 <jle`> but yeah in this case going thorugh bool isn't a huge deal
08:33 <jle`> it's another chance for a bug to pop up but it's small enough to check
08:33 <jle`> but also Bool isn't a huge loss here because CustomSuccess isnt much better
08:34 <jle`> on a human readability level you might have a bug where you switch true/false, or use when instead of unless
08:34 <MarcelineVQ> I think the actual code would be more constructive, these error's are a little misleading and your case x of ... isn't actually valid cases
08:35 takle joined
08:36 <jle`> on a "pick the right types" level, Bool "squishes" all your information to basically be 1 bit. But CustomSuccess already only has 1.6 bits of information anyway so it's not a big a deal as, say, isJust, or isLeft/isRight, or null
08:36 mengu joined
08:37 <Geekingfrog> I updated the paste with the actual code: http://lpaste.net/353844
08:39 <jle`> i think here it's not too different, going through a bool with when vs. pattern matching. i'd pattern match because it's sort of clearer to me, but the difference isn't huge
08:39 hphuoc25 joined
08:39 <jle`> btw i'm sure you know this but you can factor out all of your liftIO's to the top of the function
08:40 <jle`> but you have two other usage of bools in that snippet that are very questionable
08:40 <merijn> Also, I'd replace the let with where
08:40 <merijn> Because I hate let/in :p
08:40 <jle`> 'as == NOT_BEGUN_YET', and 'isNothing el'
08:41 <jle`> maybe they are an ocamler
08:41 <jle`> (re: let/in style)
08:41 <Geekingfrog> how would you replace the booleans ?
08:41 <jle`> even if you wanted to keep booleans, you can also use guards instead of if
08:42 <jle`> txt | as == NOT_BEGUN_YET && isNothing el = ...
08:42 <jle`> | otherwise = ...
08:42 <jle`> which isn't that bad. (i was sort of exaggerating when i said 'very questionable')
08:43 <merijn> jle`: Or just "| as == NOT_BEGUN_YET, Nothing <- el"
08:43 <jle`> but you can also pattern match on 'as' and 'el'
08:43 <jle`> or yeah, | NOT_BEGUN_YET <- as
08:43 <jle`> , Nothing <- el
08:43 <jle`> since i'm guessing NOT_BEGUN_YET is a constructor, assuming it's not some CPP magic
08:44 <Geekingfrog> nono, I'm not doing cpp there.
08:44 <lpaste_> merijn annotated “No title” with “Factor out liftIO and replace let/in” at http://lpaste.net/353844#a353846
08:44 <Geekingfrog> oÔ, first time I see the comma for a guard.
08:44 <Geekingfrog> That's neat
08:45 <merijn> Geekingfrog: ^^ see that
08:45 <jle`> case (mrAquisitionStatus mr, mrEventLocator mr) of
08:45 <merijn> Geekingfrog: That's a pattern guard, which used to be an extension, but everyone always forgets they became standard Haskell in Haskell2010 :p
08:45 <jle`> (NOT_BEGUN_YET, Nothing) -> ...
08:45 <jle`> (_, _) -> ...
08:45 stianhj joined
08:46 <jle`> but the pattern guards way is nice too
08:46 <Geekingfrog> Cool, thanks for the suggestions. I'll refactor my stuff accordingly. (once another error is dealt with)
08:46 <merijn> Oh, I think I like that better, actually
08:47 <MarcelineVQ> if you want to use an extention there's always (# mr, as, el #) = (# recMediaRecord rec, mrAcquisitionStatus mr, mrEventLocator mr #) :>
08:47 <jle`> but yeah in this case it's not particularly end of the world that you use Bool, but there's usually another way that doesn't involve going through bools that avoids all of the problems associated with bools
08:47 <lpaste_> merijn annotated “No title” with “Factor out liftIO and replace let/in (annotation)” at http://lpaste.net/353844#a353847
08:48 <merijn> I don't know what the actual error was, but that's about as clean as it gets :p
08:48 <Geekingfrog> How do you get lpaste_ notification on this channel ?
08:48 <MarcelineVQ> enter the channel in the dropdown at the top of your paste
08:48 <Geekingfrog> merijn: it's something unrelated to this snippet
08:48 <merijn> Geekingfrog: Just select the right channel in the dropdown :)
08:48 <Geekingfrog> cool
08:49 <jle`> you also have to type in your nick
08:49 <merijn> If you select #haskell-beginners it automatically pastes it here
08:49 <jle`> it won't notify it unless a person with the nick is in the channel i think
08:49 <merijn> Could be
08:49 <MarcelineVQ> seems like it
08:50 <lpaste_> MarcelineVQ pasted “doop” at http://lpaste.net/353849
08:50 <MarcelineVQ> confirm-ed
08:52 <lpaste_> jle` annotated “No title” with “pattern matching on the tuple from the start because why not” at http://lpaste.net/353844#a353850
08:54 <merijn> jle`: Good point
08:54 <jle`> also the fact that the function is uncurried bothers me more than it should
08:54 <jle`> but i understand that it'll eventually be used in the uncurried form
08:54 <merijn> But, what was the original error? Because I don't think we've done anything beyond nitpicking syntax :p
08:54 <jle`> there was no original error
08:54 <jle`> it was a style question i think from the beginning
08:55 <Geekingfrog> indeed
08:55 <jle`> this is my favorite 2am hobby by far
08:56 <merijn> ah
08:56 <MarcelineVQ> is the day so young
08:56 <merijn> Refactoring ugly haskell into pretty haskell is always a fun hobby :p
08:57 gregman_ joined
08:59 grayjoc joined
09:00 <Geekingfrog> Getting haskell to work at all spoils the fun sometimes though
09:01 <merijn> Geekingfrog: Depends what you're used too. I'd much rather struggle with the Haskell than C++ and python like I normally do >.<
09:01 <Geekingfrog> Yeah ofc. I'm starting to feel pretty confident with haskell now, which is good.
09:02 <Geekingfrog> A few months ago it would take hours just to get some simple stuff (http, parsing, streaming) done, but now it's getting much better.
09:03 <merijn> Geekingfrog: Once you "get" it, suddenly you're productivity starts ramping up fast :)
09:03 <merijn> *your
09:05 Jackoe joined
09:11 mojjo joined
09:13 Durz0 joined
09:14 takle_ joined
09:21 skapazzo joined
09:23 takle joined
09:24 NoCreativity_ joined
09:25 uglyfigurine joined
09:32 <Geekingfrog> Btw, is there a standard conduit function to perform an action without modifying elements? I find I'm doing things like mapMC (\x -> doStuff x; pure x) which doesn't look right
09:33 <merijn> Geekingfrog: I remember there was, but I might be wrong and just have written a wrapper myself
09:42 mengu joined
09:43 mengu_ joined
09:43 splanch joined
09:44 <eatman> Hi. Do you guys have any good Vim plugin for Haskell's indentation please?
09:45 galderz joined
09:45 <eatman> For now i'm using the ghc-mod but it "only" helps me check the code, no autoindent.
09:47 <eatman> I also have https://github.com/itchyny/vim-haskell-indent but it fails on "simple files" like the firts example here http://www.yesodweb.com/book/basics
09:47 howdoi joined
09:47 <merijn> I started writing my own, but vim's indentation support is not very greatly suited to Haskell
09:50 <eatman> Yeah, and the Emacs's haskell mode works perfectly...
09:50 galderz joined
09:55 <eatman> I added a request for the indent plugin dev, wait and see.
09:58 slomo joined
10:01 mengu joined
10:01 mojjo joined
10:03 marvin2 joined
10:06 splanch joined
10:08 Durz0 joined
10:09 splanch_ joined
10:10 Pupnik joined
10:23 hexagoxel joined
10:25 merijn joined
10:26 hphuoc25 joined
10:27 splanch joined
10:31 madjestic joined
10:33 <eatman> merijn: do you know hindent?
10:37 <merijn> eatman: I've heard of it, but not really used it
10:39 contiver joined
10:39 <eatman> Well, it works.
10:40 <eatman> I see your config is quoted at https://wiki.haskell.org/Vim#Indentation
10:40 <eatman> Can I try you indent plugin?
10:44 splanch joined
10:46 takle joined
10:54 merijn joined
10:54 galderz joined
11:00 snowcrshd joined
11:02 ederign joined
11:04 <rockfruit> Is there a haskell form of what pythoncalls "substr in string" or "obj in iterator"? I've found findIndex in several modules, but I've also read someone saying "Are you thinking imperatively? Stop it." and "Think what you want to do, then do it." Well I don't know what that means, but I do think that maybe trying to define my own "in" function for strings, might be a symptom of not thinking in
11:04 <rockfruit> haskell. please help me discuss?
11:04 <sbrg> > 3 `elem` [1, 2, 3]
11:04 <lambdabot> True
11:04 <rockfruit> heh.
11:05 <sbrg> > "foo" `isInfixOf` "foobar"
11:05 <lambdabot> True
11:05 <sbrg> an "iterator" in haskell would just be a lazy list or some other streamy thing
11:05 <sbrg> :t elem
11:05 <lambdabot> (Eq a, Foldable t) => a -> t a -> Bool
11:05 condy joined
11:05 <sbrg> and elem works on all such things that are foldable
11:05 <rockfruit> > elem "foo" "foobar"
11:05 <lambdabot> error:
11:05 <lambdabot> • Couldn't match type ‘Char’ with ‘[Char]’
11:05 <lambdabot> Expected type: [[Char]]
11:05 <sbrg> rockfruit: were those the ones you were looking for?
11:06 galderz joined
11:06 <sbrg> > elem "foo" ["foo", "bar"]
11:06 <rockfruit> sbrg absolutely.
11:06 <lambdabot> True
11:06 <sbrg> here "foo" is a string, so if you want to see if it's an element of something, then that something must be a 'container' of strings.
11:06 <rockfruit> so elem will not really do "substring" the way I understand, as "foo" is not an "element" of "foobar", while 'f' is?
11:06 <sbrg> if you you want to check if something is "a substring", then you want `isInfixOf`
11:07 <sbrg> exactly
11:07 <sbrg> there's also isPrefixOf and isSuffixOf
11:07 <sbrg> :t isSuffixOf
11:07 <lambdabot> Eq a => [a] -> [a] -> Bool
11:07 <rockfruit> > isInfixOf [1,2,3] [1..4]
11:07 <sbrg> yeah
11:07 <lambdabot> True
11:07 <rockfruit> woo!
11:08 <sbrg> also, for future reference. do you know about hoogle? for cases like this, if you can just "imagine the type" that the function you are looking for kinda sorta probably has, you can often find it using hoogle.
11:08 <sbrg> for example, since I know that a "substr" function would take two lists of some sort and return a boolean, I can ask:
11:08 <sbrg> @hoogle [a] -> [a] -> Bool
11:08 <lambdabot> Data.List.Match equalLength :: [a] -> [b] -> Bool
11:08 <lambdabot> Data.List.Match lessOrEqualLength :: [a] -> [b] -> Bool
11:08 <lambdabot> Util equalLength :: [a] -> [b] -> Bool
11:08 <rockfruit> I've seen people saying "I searched for [Int]->Int->Int and found nothing", now I know what they were talking of.
11:08 <sbrg> yeah okay, so that was a shitty example :D
11:09 <sbrg> @hayoo [a] -> [a] -> Bool
11:09 <lambdabot> Unknown command, try @list
11:09 <rockfruit> @hoogle String -> String -> Bool
11:09 <lambdabot> System.Path.WildMatch wildCheckCase :: String -> String -> Bool
11:09 <lambdabot> Text.XML.HXT.DOM.QualifiedName equivUri :: String -> String -> Bool
11:09 <lambdabot> Text.XML.HXT.Parser.HtmlParsec isInnerHtmlTagOf :: String -> String -> Bool
11:09 <rockfruit> (that's what I would naively have hoogled earlier)
11:09 <sbrg> well, that's absolutely useless
11:09 <sbrg> both of them
11:09 <sbrg> I'm not sure why hoogle isn't returning isPrefixOf and friends
11:10 <sbrg> @hoogle isPrefixOf
11:10 <lambdabot> Data.List isPrefixOf :: (Eq a) => [a] -> [a] -> Bool
11:10 <lambdabot> Data.List.NonEmpty isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool
11:10 <lambdabot> GHC.OldList isPrefixOf :: (Eq a) => [a] -> [a] -> Bool
11:10 <sbrg> @hoogle (Eq a) => [a] -> [a] -> Bool
11:10 <lambdabot> Data.List isPrefixOf :: (Eq a) => [a] -> [a] -> Bool
11:10 <lambdabot> Data.List isSuffixOf :: (Eq a) => [a] -> [a] -> Bool
11:10 <lambdabot> Data.List isInfixOf :: (Eq a) => [a] -> [a] -> Bool
11:10 <sbrg> there we go
11:10 <sbrg> the Eq constraint helped narrow it down
11:11 <sbrg> FWIW, it seems that hayoo is better at returning relevant results, at least in this case
11:13 <rockfruit> yip, that found it on the first attempt.
11:13 <rockfruit> @list
11:13 <lambdabot> What module? Try @listmodules for some ideas.
11:13 seagreen_ joined
11:13 splanch joined
11:13 <rockfruit> oh, no @hayoo, I saw you tried earlier.
11:14 <rockfruit> anyway thanks, I've narrowly avoided a cigarette and a whisky in one quick question/answer.
11:17 cab12 joined
11:19 <cab12> functions have Functor instances, why are they called reader?
11:26 <dibblego> the functor is defined over a function argument, a thing that is read
11:28 <Akii> I've trouble finding better data types for my problem; anyone got an idea? http://lpaste.net/353855 /cc benzrf
11:28 <Akii> currently trying to find a way to make many invalid states impossible
11:29 <Akii> but somehow haven't found a good way yet, maybe lacking some patterns
11:31 hphuoc25 joined
11:43 Jackoe joined
12:24 eacameron joined
12:29 grayjoc joined
12:41 takle joined
12:51 raduom joined
12:51 splanch joined
12:52 <raduom> I am having issues understanding a instance definition from https://hackage.haskell.org/package/exceptions-, specifically, what does (~) * e SomeException => MonadThrow (Either e) mean?
12:58 <geekosaur> it's confused by the way haddock exposes kind constraints
12:58 aarvar joined
13:00 <geekosaur> "instance e ~ SomeException => MonadThrow (Either e) where" from the source
13:00 <geekosaur> oh, so it's not just kind constraints it mangles...
13:02 <raduom> That says that for some type 'e' equivalent to SomeException?
13:03 <geekosaur> yes. which I think is a hack
13:03 <raduom> that is odd since there are no type families involved.
13:03 <geekosaur> (possibly to shut ghc up about an instance head with no type variables in it)
13:04 <raduom> cute. thanks. i have to go now. be well.
13:09 ThomasLocke joined
13:12 Gloomy joined
13:12 mengu joined
13:13 raduom joined
13:23 shayan_ joined
13:23 splanch joined
13:33 blissdev joined
13:34 splanch joined
13:34 pbrant joined
13:35 pbrant joined
13:45 hphuoc25 joined
13:48 mizu_no_oto_work joined
13:52 Gloomy joined
13:53 Gloomy joined
13:54 splanch left
13:57 skapazzo joined
14:05 merijn joined
14:07 jomg joined
14:11 yellowj joined
14:18 netheranthem joined
14:27 carlomagno1 joined
14:33 Cheburan joined
14:35 conal joined
14:37 raduom joined
14:42 e14 joined
14:46 guampa joined
14:51 ThomasLocke joined
14:53 freeside joined
14:54 Gurkenglas_ joined
15:05 uglyfigurine joined
15:05 <Cheburan> Hi all
15:06 <Cheburan> If I have type such as data Stream a = a :& Stream a
15:06 <Cheburan> and want to define Stream of Num and (+) for
15:07 <Cheburan> it
15:07 <Cheburan> I wrote this
15:07 <Cheburan> instance Num a => Num(Stream a) where (+) = streamAdd streamAdd :: Stream a -> Stream a -> Stream a streamAdd (a1 :& a2) (b1 :& b2) = (a1 + a2) :& (streamAdd a2 b2)
15:08 takle joined
15:09 pbrant joined
15:09 <Cheburan> getting error Couldn't match expected type ‘a’ with actual type ‘Stream a’ ‘a’ is a rigid type variable bound by the type signature for: streamAdd :: forall a. Stream a -> Stream a -> Stream a
15:12 <hexagoxel> Cheburan: rename your variables to something better than x1 and x2, especially when those don't refer to the first and second element of some container.
15:13 <geekosaur> ^ because you have confused something, you are indeed trying to use a and Stream a as if they are the same type
15:14 pie_ joined
15:15 pie_ joined
15:19 Jackoe joined
15:20 <Cheburan> quot "you are indeed trying to use a and Stream a as if they are the same type" ok, but I can't understand how to correct code
15:21 <Cheburan> steamAdd should take to Streams of Num and sum their elements
15:22 lithie joined
15:25 <geekosaur> you deconstruct each stream to get a1, a2, b1, b2. a1 and a2 (presumably of type a) you add together; then you use a2 again with a recursive streamAdd call, which requires a2 (already fixed as type a) to be a Stream a
15:25 <geekosaur> hm, no, a2 is Stream a but you add it to a1 which is type a
15:26 <geekosaur> :t (+)
15:26 <lambdabot> Num a => a -> a -> a
15:26 <geekosaur> same a throughout, you cannot add an a to a Stream a
15:26 <hexagoxel> the error is really rather mundane and obvious once you rename.
15:26 <* geekosaur> missed the definition of Stream
15:27 <hexagoxel> another hint is that b1 is never used on the right-hand-side.
15:27 <geekosaur> and there's a likely simple fix
15:27 expo873 joined
15:30 <hexagoxel> (would be cool if ghc showed unused-warnings even in presence of type errors.. iirc it does not)
15:30 <geekosaur> (uh, rephrase: it is both likely and simple, not that it is likely to be simple)
15:33 <hexagoxel> "streamAdd (a_first :& a_rest) (b_first :& b_rest) = (a_first + a_rest) :& (streamAdd a_rest b_rest)"
15:33 <Cheburan> thanks, that was my mistake, after correcting another error "No instance for (Num a) arising from a use of ‘+’ Possible fix: add (Num a) to the context of the type signature for: streamAdd :: Stream a -> Stream a -> Stream a"
15:34 <Cheburan> tried "streamAdd :: Num(Stream a) -> Num(Stream a) -> Num(Stream a)" but also no luck
15:34 <geekosaur> yes, that makes no sense
15:34 <hexagoxel> streamAdd :: Num a => Stream a -> Stream a -> Stream a
15:35 <merijn> Or, just use the 'a' and 'as' and 'b' 'bs' common use :)
15:37 <merijn> The further I get, the more I like that idiom, it's very flexible :)
15:37 <Cheburan> "streamAdd :: Num a => Stream a -> Stream a -> Stream a" worked! Thanks a lot
15:38 <hexagoxel> until you need also need a name for the whole, thus i prefer as@(a1:ar)
15:45 hphuoc25 joined
15:57 owiecc joined
15:58 snowcrshd joined
15:59 uglyfigurine joined
16:01 uglyfigurine joined
16:08 Gurkenglas joined
16:10 tom7942 joined
16:12 dpren joined
16:18 owiecc joined
16:32 tom7942 joined
16:32 pbrant joined
16:33 pbrant joined
16:36 pbrant joined
16:37 pbrant joined
16:42 e14 joined
16:53 MitchellSalad joined
16:53 uglyfigurine joined
17:02 chrissl joined
17:05 t0by joined
17:05 t0by joined
17:07 evil-t0by joined
17:11 mengu joined
17:16 smichel17 joined
17:23 skapazzo joined
17:27 jathan joined
17:28 zero_byte joined
17:30 louispan joined
17:44 kritzcreek_ joined
18:06 Uniaika joined
18:19 e14 joined
18:37 delexi joined
18:40 m1dnight_ joined
18:47 peterbecich joined
18:48 hphuoc25 joined
18:49 shoglok joined
18:50 <shoglok> hey guys. can someone help me to solve this? I have an infinite list, containing lists. It's a stream of combinations of given numbers, first all combinations with length 1, then with length 2 etc.
18:50 <shoglok> now i have to filter all elements of the list which sums up to a given value X
18:51 mengu joined
18:51 <shoglok> i just could think of one primitive way to do this: if the nr. of elements is >= X i can terminate, cause then every element that follows will be > X
18:51 <shoglok> but this takes too long
18:52 splanch joined
18:53 m1dnight_ joined
18:59 <Akii> shoglok: got some code to share? (lpaste)
19:00 ScarieBlowfish joined
19:02 m1dnight_ joined
19:02 <shoglok> Akii: yes sure, here it is: http://lpaste.net/7609497281783398400
19:03 <shoglok> filter_turns_ts.. this should make a list out of the infinite stream
19:03 <shoglok> but caution, if you call it like in the comment in the last line, it iwll never terminate
19:06 handlex joined
19:07 snowcrshd joined
19:07 mengu joined
19:09 colt44 joined
19:14 <Akii> shoglok: can't think of a better way of stopping there
19:15 <shoglok> Akii: thank you! i just could think of one improvment, but i think it is still not that good
19:15 drewr joined
19:16 <shoglok> the list of list is ordered by the length of the lists [1] [2] [1,1] [1,2] [2,2]... so when it is not possible to have a value <= with all lists of length == n, then it will never be possible with lists of length > n
19:17 <Akii> that all relies on you knowing the algorithm that produces the inf list
19:17 <shoglok> yes, thats the only thing i can assume, the list of lists is sorted by the length of the lists
19:18 <shoglok> but i think there is no better way than this i guess
19:25 Cheburan joined
19:33 MotherFlojo joined
19:38 nepiktaz joined
19:42 hoffmeyer joined
19:53 m1dnight_ joined
19:55 colt44 joined
20:01 malaclyps joined
20:17 Rodya_ joined
20:19 takle joined
20:21 niez joined
20:22 buoto joined
20:42 curious_corn joined
20:43 owiecc joined
20:52 Jackoe joined
20:57 snowcrshd joined
21:05 taksuyu joined
21:07 conal joined
21:09 yellowj joined
21:10 marvin2 joined
21:13 prophile joined
21:14 nomotif joined
21:21 prophile joined
21:30 djfo joined
21:39 nyuszika7h joined
21:42 zero_byte joined
21:51 djfo left
21:52 hiratara joined
21:54 contiver joined
21:55 uglyfigurine joined
21:55 Rodya_ joined
22:00 Rodya__ joined
22:22 tom7942 joined
22:22 takle joined
22:25 marvin2 joined
22:31 hiratara joined
22:31 t0by joined
22:31 t0by joined
22:44 Rodya_ joined
22:57 malaclyps joined
23:11 louispan joined
23:16 nepiktaz joined
23:43 yellowj joined
23:45 eacameron joined
23:47 Rodya_ joined
23:50 eacameron joined