<    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 24 25  
26 27 28 29 30 31
00:01 <ExpHP> That's a lie, I CAN imagine why: currying
00:02 Jacoby6000 joined
00:06 eschnett joined
00:07 <Cale> ExpHP: Why the PackageImports?
00:08 tauli joined
00:08 <ExpHP> oh, I just do that everywhere
00:08 <ExpHP> makes it easier to remember what packages to install when moving things around
00:09 <ExpHP> (in other words, because copy paste >_>)
00:12 splanch joined
00:12 <Cale> ExpHP: There's often a bit of competition between the order in which currying suggests is best (i.e. most frequently changing arguments last), and the order in which it's convenient to write long expressions (longest argument last)
00:13 modal joined
00:13 <ExpHP> This particular case would seem to be a slam dunk for me though, because you never want to use a shell twice
00:13 <ExpHP> (because it would end up running twice)
00:15 <ExpHP> I think the actual motivation behind this argument order is to feel more natural in imperative-looking code
00:16 <ExpHP> Then again all the examples in the tutorial have an embedded expressino for the shell (https://hackage.haskell.org/package/turtle-1.3.2/docs/Turtle-Tutorial.html)
00:16 sanett joined
00:16 migimunz joined
00:16 nomicflux joined
00:16 <ExpHP> oops, no wait, never mind, I just remembered the actual reason, which I discovered earlier
00:17 cpup joined
00:17 <ExpHP> (it's because a Shell is a newtype around FoldM, so foldIO just pretty much takes after the record field method)
00:17 <Cale> Yeah, I don't really know -- given that you can't just write a function in place of the Fold/FoldM, the reason isn't so that you can hang ... $ \x -> ... off the end
00:18 yogsotot_ joined
00:18 <Cale> (and it's not a Monad, so you also can't have a do-expression there)
00:19 <ExpHP> see what I mean? Square peg, round hole :)
00:19 <Cale> (but on the other hand, Shell *is*)
00:20 sanett joined
00:20 sleffy joined
00:21 biotim left
00:21 animated joined
00:22 e14 joined
00:22 plutoniix joined
00:25 plutoniix joined
00:27 <c_wraith> > do ()
00:28 <lambdabot> ()
00:28 aib joined
00:28 <c_wraith> sometimes no monad needed. just to confuse things.
00:28 sanett joined
00:29 <ExpHP> > (error "not party time") <$> ()
00:29 <lambdabot> error:
00:29 <lambdabot> • Couldn't match expected type ‘f a0’ with actual type ‘()’
00:29 <lambdabot> • In the second argument of ‘(<$>)’, namely ‘()’
00:29 <ExpHP> > :i ()
00:29 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
00:29 <ExpHP> @halp
00:29 <lambdabot> help <command>. Ask for help for <command>. Try 'list' for all commands
00:29 <robkennedy> Lambdabot lacks :i
00:29 <* ExpHP> goes to bug lambdabot in query
00:30 <geekosaur> lambdabot is not ghci, it doesn't do :i
00:30 <boxscape> @undo do ()
00:30 <lambdabot> ()
00:30 afnizarnur joined
00:31 data_hope joined
00:31 Welkin joined
00:31 <ExpHP> what is going on there to make that work? since () isn't a monad
00:31 <geekosaur> do notation is mechyanically translated. it doesn;t actually care about monads
00:31 <boxscape> do x is just replaced with x by the compiler
00:31 <geekosaur> the typechecker cares about monads after the translation is done
00:31 <ExpHP> ...oh
00:31 <boxscape> https://www.haskell.org/onlinereport/exps.html
00:31 carlosda1 joined
00:31 <boxscape> 3.14
00:32 sanett joined
00:32 cpup joined
00:32 <geekosaur> (or about applicatives if you have ApplicativeDo enabled)
00:32 <ExpHP> hm, but it checks that all the types match on each line?
00:32 <ExpHP> oh wait, nvm :)
00:32 <geekosaur> actually I suspect it has to care about types with ApplicativeDo because the translation is much different
00:33 <c_wraith> or just that there are functions named >> and >>= in scope if you are using rebindable syntax
00:33 augur joined
00:33 <boxscape> I do believe they need to do something to have the error messages display the correct file location after desugaring
00:33 MarioBranco joined
00:33 tromp joined
00:33 <geekosaur> well, desugaring is done at the AST level so that's already a problem (and already handled)
00:34 <boxscape> ah, I see
00:34 <geekosaur> that is, the initial AST from the parser has "do" nodes in it
00:34 andyhuzhill joined
00:35 dylukes joined
00:38 splanch joined
00:39 _m_ryan joined
00:39 <_m_ryan> hi anyone yesod dev here?
00:39 <robkennedy> Is a lisp more than a Monad on source code? By which I mean a function `lisp :: [Expression] -> Either Value [Expression]` and `eval :: State -> Expression -> (State,[Expression])`
00:40 <robkennedy> _m_ryan: I've used Yesod, but it's extremely opinionated for Haskell so I stopped. May be able to help if you have a question.
00:40 eazar001 joined
00:41 <_m_ryan> yes i don have robkennedy,
00:41 <_m_ryan> i do have a custom form it has checkbox and select with multiple so i was expecting a list of data on my handler in post method.
00:41 <Koterpillar> robkennedy: you've described every interpreter ever
00:41 arpl left
00:41 <_m_ryan> can you help me about it?
00:42 <robkennedy> Koterpillar: idk how would you describe a lisp vice Haskell?
00:42 sanett joined
00:42 <_m_ryan> i'm a noob ok yesod haskell so don't have much idea about
00:43 <Welkin> lol, hello _m_ryan
00:43 <_m_ryan> hi Welkin :)
00:43 <robkennedy> Haskell does not inject terms to be evaluated. Actually I'd push back on that: most programming languages do not need the possibility for consuming a word to add words
00:43 <Koterpillar> robkennedy: if you define Expression differently, this can be, for example, Python
00:44 <Koterpillar> robkennedy: btw, it's not [Expression] but S Expression Expression
00:48 emmanuel_erc joined
00:48 sleffy joined
00:49 <robkennedy> I should not be so bold to attempt to type Lisps. But, if you interpret a python program, and begin by interpreting every word in it, you will still interpret the program (modulo promises for words to be defined). In contrast, a Lisp injects new words into its source code. That is my understanding - is it flawed
00:49 <robkennedy> *injects new words as it is evaluated
00:49 <Welkin> lisp is an ast
00:50 <Koterpillar> To my memory, Lisp is an imperative language that doesn't modify the _source_ but construct new expressions in memory
00:50 <Koterpillar> Python can do that too as it has 'eval'
00:50 <Welkin> the myth of lisp being "functional" seems to continue
00:50 <Welkin> only scheme is functional D:<
00:50 vektorweg1 joined
00:50 <Koterpillar> Welkin: it has imperative semantics too
00:51 Rodya_ joined
00:51 <Welkin> Koterpillar: yes
00:51 <robkennedy> Welkin: do you dispute the premise of clojure?
00:51 mizu_no_oto joined
00:51 <Koterpillar> robkennedy: do you have an example of a Lisp program injecting new words into its source code?
00:52 <Koterpillar> robkennedy: or a definition of bind in your Lisp monad, I'm curious to see where do the extra Expressions end up
00:52 <johnw> does anyone happen to have a clone of megacz's ghc-hetmet code?
00:53 sanett joined
00:53 Stanley00 joined
00:54 <robkennedy> Koterpillar: no; a friend asked me the difference between clojure and Haskell, and I tried to describe the idea of "compile the whole program" vs "a program whose compilation is equivalent to it's execution"; a difference I understand​, and which makes sense as a dichotomy, and whose only example I could imagine was a program which injected source code
00:54 conal joined
00:55 <Koterpillar> robkennedy: compilation is merely an optimisation
00:55 <robkennedy> My clojure coworker brags about homoiconicity, which I am unimpressed by, but seems possibly unique given the description
00:55 <robkennedy> Koterpillar: that's not right
00:55 <Koterpillar> robkennedy: you can build an interpreter for Clojure, and compiler for both Scheme and your hypothetical "injecting source code" language
00:56 <Welkin> there is more to the difference between the two than *that* O.o
00:56 Micamo joined
00:56 <Welkin> you never even mentioned the type system?
00:56 jao joined
00:56 dsh joined
00:57 halogenandtoast joined
00:57 cyborg-one joined
00:58 <robkennedy> Welkin: sure, there are many differences. What if the distinguishing features of clojure vs python vs Haskell ? Yeah static typing is nice, but it's not unique (nor is dynamic typing)
00:58 <Koterpillar> anyway, Lisp doesn't modify its own source any more than Python
00:58 <robkennedy> I did mention typing; it's not attractive to physicists
00:58 <robkennedy> (who don't code)
00:59 <Welkin> robkennedy: the other two languages you listed there do not have an advanced type system
00:59 <davean> Koterpillar: Uh?
00:59 <davean> Koterpillar: I've regularly done far deeper modifications in lisps then python has any ways I know of of describing short of bytecode reinterpritation
01:00 <robkennedy> Welkin: sorry, I mean: assuming you have justified both python and Haskell, how do you justify Lisps?
01:01 <robkennedy> Koterpillar: python 3.5 eval isn't magic
01:01 <davean> It isn't even CLOSE
01:01 bryanlemon joined
01:01 taksuyu joined
01:02 <Koterpillar> well, sorry, you can't do meaningful _modifications_ to Python code, but you can _replace_ functions and such with monkey-patching
01:02 mariano__ joined
01:02 <davean> Koterpillar: sure, but how do I know how thsoe functions worked in the first place?
01:02 <Koterpillar> you don't, they are all black boxes to you
01:02 <Koterpillar> Lisp wins here
01:02 <davean> its not even a shadow of it
01:03 <davean> python has nothing even comparable to lisp's self-modification
01:03 <robkennedy> Koterpillar: at some point you're saying "eval is Turing complete"
01:03 <Koterpillar> I didn't mean that, let me rephrase
01:03 <davean> I can't do a single thing I've actually used lisp's homoiconicity to accomplish in python
01:03 <davean> not a single thing!
01:04 <Koterpillar> both Python and Lisp have facilities to inspect and modify the currently running program in memory. Lisp can go deeper thanks to its extremely simple AST.
01:04 <sophiag> quick question: if i
01:04 <Koterpillar> sophiag: that was super quick :)
01:04 <ExpHP> gosh darned enter keys
01:04 <sophiag> ha. sorry getting used to new keyboard :p
01:05 <sophiag> anyways...if i define a data type and use "deriving (Show)" i still need to provide Show as a type constraint to use it, right? for example, if i want to print to ghci?
01:06 <davean> sophiag: yes
01:06 <Koterpillar> Both Python and Lisp can be compiled or interpreted, so whether compilation is execution or not is irrelevant.
01:06 ixti joined
01:06 <davean> If you ahve a type variable, you have to know what that type variable supports
01:06 <Welkin> sophiag: to use it? What do you mean?
01:06 <Koterpillar> sophiag: no
01:06 <Koterpillar> sophiag: only if it has parameters
01:06 <sophiag> wait...yes, no?
01:06 <Welkin> constraints are on the functions
01:06 <davean> Koterpillar: I mean, what can't be considered that?
01:06 Kundry_Wag joined
01:06 <davean> Koterpillar: I mean, you can say the same thing about C or ASM
01:07 <Welkin> as long as the data you apply them to support the type classes required, you don't provide any other information
01:07 <robkennedy> sophiag: depends. Ie `data T a = T Int deriving Show` probably doesn't need `Show a`
01:07 <Koterpillar> davean: that was my original point to robkennedy - defining an eval so generic describes every interpreter, not just Lisp
01:07 <sophiag> it does not have parameters, but ghci still is giving me that error "Now instance for (Show (..))"
01:07 <Koterpillar> show what you've defined
01:08 migimunz joined
01:08 <sophiag> and i'm unsure the syntax for using it as a constraint given i'm not using type variables in the signatures of the functions
01:08 <Koterpillar> maybe you're showing a different thing?
01:08 <sophiag> Koterpillar: like this "data Amb = Amb { tag :: Maybe String, value :: HList } deriving (Show)"
01:08 <robkennedy> Koterpillar: that seems like exactly the statement "eval is Turing complete"
01:08 <sophiag> and then i have functions of type (Exp -> Amb) and (Exp -> Exp -> Amb)
01:09 <ExpHP> I don't suppose HList implements Show?
01:09 <sophiag> ExpHP: it does
01:10 <Koterpillar> robkennedy: which is correct and not specific to Lisp. Where does that extra [Expression] go?
01:10 <ExpHP> ...that's wild
01:10 <Koterpillar> sophiag: what's your error message?
01:10 <MarcelineVQ> what does the error actually say
01:10 aarvar joined
01:10 mmachenry joined
01:10 <sophiag> oh, actually HList prints...
01:10 <sophiag> hmm
01:11 <sophiag> but the record using it does not
01:11 MarioBranco joined
01:11 <sophiag> Koterpillar: "No instance for (Show (Exp -> Amb)) arising from a use of ‘print’"
01:11 <ExpHP> Oh
01:12 <ExpHP> Look: You're printing a function
01:12 <sophiag> yes
01:12 <Welkin> lol
01:12 <Welkin> you can't print a function
01:12 <sophiag> so does that mean i _do_ need the constraint?
01:12 <sophiag> wait...i just can't?
01:12 <Welkin> if you want to, you need to define a Show instance for it
01:12 <ExpHP> apply the function to a value
01:12 [k- joined
01:12 <sophiag> Welkin: that was my question to begin with!
01:12 <Welkin> but then, what should it be?
01:12 <ExpHP> (or perhaps I should ask, is there some reason you havent?)
01:13 <Welkin> it could be anything
01:13 jao joined
01:13 Younder joined
01:13 <sophiag> haven't defined Show as a constraint?
01:13 <Welkin> what?
01:13 <Welkin> no
01:13 johnmendonca joined
01:13 <Welkin> print requires a Show instance
01:13 <Welkin> you could have ghc derive it for you automatically or define it yourself
01:14 <sophiag> whether i needed a show instance was my original question
01:14 <Welkin> in this case, ghc doesn't know what to do because it is a function
01:14 <Welkin> how do you print a function?
01:14 <sophiag> someone said yes, another said no
01:14 <Koterpillar> you don't need it to print that record
01:14 <sophiag> i've been leaving you guys to work out which one is the correct answer. lol
01:14 <Koterpillar> but you aren't printing that record
01:14 <Welkin> what does printing a function even mean?
01:14 <Koterpillar> you are printing a function
01:14 <sophiag> i'm printing the return value of that function
01:14 <Welkin> sophiag: obviously not, though
01:14 <tobiasBora> Hello,
01:14 <tobiasBora> I wrote something like:
01:15 <tobiasBora> sum <$> forM lastMedias $ \node ->
01:15 <tobiasBora> (node .: "likes") >>= (.: "count")
01:15 <Koterpillar> show the code where you're trying to do that?
01:15 oisdk joined
01:15 splanch joined
01:15 <tobiasBora> However it does no work because of priority of operators I think
01:15 <tobiasBora> If I for the forM .... between parents it works
01:16 <tobiasBora> so what is the haskell solution to write this without ugly parents ?
01:16 <ExpHP> tobiasBora: yeah, $ is lowest precedence so it will occur before <$>
01:16 <ExpHP> (I mean after)
01:16 <ExpHP> fmap sum $
01:16 <tobiasBora> ExpHP: So I can't use the beautiful operator <$> here
01:16 <sophiag> Koterpillar: http://lpaste.net/354047
01:17 Supersonic112 joined
01:17 <robkennedy> Koterpillar: the statement "a Turing complete sublanguage of language A replicates language B" is trivial. Originally I hoped to say something like `lispStep :: (State,Expression) -> (State,[Expression])`, vice ie a python compiler, which might be written `compileStep :: (State,Expression) -> State`
01:17 <ExpHP> tobiasBora: tragically, I think so
01:17 <tobiasBora> Ohh :(
01:17 <tobiasBora> Thank you!
01:17 <ExpHP> (at least that's how I handle it)
01:17 <sophiag> (not getting involved in this Lisp discussion...i'm trying to move on with my life and learn Haskell...lol)
01:18 nighty- joined
01:18 esph joined
01:19 <Koterpillar> robkennedy: I think the type of your lispStep is wrong, and the right type is closer to compileStep (and Python). Where does the second part of the result go?
01:19 edvorg joined
01:20 systadmin joined
01:20 <Koterpillar> sophiag: where are you calling 'show'?
01:20 <ExpHP> sophiag: and for full measure, the lines you're putting in ghci?
01:20 tromp joined
01:21 afnizarnur joined
01:21 mizu_no_oto joined
01:22 nomicflux joined
01:22 peterbec` joined
01:22 <sophiag> i'm not calling show
01:22 <Koterpillar> robkennedy: where Lisp is different from, let's pick a better scapegoat, C, is that State = Map String Expression (or some approximation of such), whereas if you wanted to represent C, best you could do would be State = [Byte]
01:22 <sophiag> i'm just testing functions in ghci
01:23 <Koterpillar> sophiag: what expression gives you the error?
01:23 <sophiag> "parseList $ fromParseResult $ parseExp "[1, 2, 5]"" returns "IList [1,2,5]"
01:24 Kallis joined
01:24 <sophiag> "parseAmbTagged $ fromParseResult $ parseExp "foo [1, 2, 5]"" throws the error
01:24 <Koterpillar> parseAmbTagged has two arguments
01:24 <Koterpillar> you gave it one
01:24 <tobiasBora> :t msum
01:24 <lambdabot> (MonadPlus m, Foldable t) => t (m a) -> m a
01:24 gugah joined
01:25 <tobiasBora> :t fmap
01:25 <lambdabot> Functor f => (a -> b) -> f a -> f b
01:25 <Koterpillar> sophiag: try this: ":t parseAmbTagged $ fromParseResult $ parseExp "foo [1, 2, 5]""
01:25 <tobiasBora> :t fmap sum
01:25 <lambdabot> (Num b, Foldable t, Functor f) => f (t b) -> f b
01:25 <robkennedy> Into the next evaluation of lispStep, of course! Contrast `lispCompile s (x:xs) = case lispStep s x of {(s',es) -> lispCompile s' (es ++ xs)}` with `pythonCompile s (e:es) = pythonCompile (compileStep s e) es`
01:25 <tobiasBora> I don't understand why "fmap sum" works, but not "msum"...
01:26 <sophiag> Koterpillar: seems i need to rewrite the function
01:26 emmanuel_erc joined
01:26 <sophiag> :p
01:26 <sophiag> parseAmb works
01:26 <sophiag> sorry for the waste :p
01:26 mda1 joined
01:27 <ExpHP> sophiag: perhaps not
01:27 <Koterpillar> robkennedy: I don't know of any Lisp function that would return a non-empty [Expression] list, can you give an example?
01:27 <robkennedy> Koterpillar: (3)?
01:27 <ExpHP> sophiag: can you call parseAmbTagged with two arguments?
01:27 FreeBirdLjj joined
01:27 <sophiag> ExpH: that's besides the point...it's meant to parse an AST
01:28 <sophiag> so i need to use one argument and match for different types
01:28 <Koterpillar> robkennedy: what is that supposed to do?
01:28 <robkennedy> Return the value 4
01:28 <ExpHP> oh, then yeah
01:28 <robkennedy> Wow.... I meant 3
01:28 <Koterpillar> robkennedy: not in any Lisp I know will (3) return the value 3 instead of complaining that 3 isn't a function
01:29 <Koterpillar> robkennedy: i.e. (+ 1 2) has _result_ 3, which is output to the console if you're in a REPL, but doesn't _modify the source_
01:30 dfeuer joined
01:30 <Koterpillar> robkennedy: def will update the name table (see my definition of state), but even then the function body isn't executed until called.
01:30 <robkennedy> Koterpillar: let's not hide ourselves . (if True (3) 2) returns 3
01:31 [k-_ joined
01:31 aarvar joined
01:31 migimunz joined
01:32 <Koterpillar> robkennedy: you can do that without the second output of lispCompile, by having this, at some point, call if :: Expression -> Expression -> Lisp
01:32 <Koterpillar> robkennedy: are you trying to build a stack machine?
01:32 carlosda1 joined
01:32 data_hope joined
01:33 orphean_ joined
01:33 <Koterpillar> that will actually work, but again, not just in Lisp
01:34 <robkennedy> No, I'm trying to explain to a physics PhD why Lisps are not on the same axis as static vs dynamic typing
01:34 <Koterpillar> which is correct
01:34 <Koterpillar> afk
01:36 takle joined
01:40 edvorg joined
01:40 <Welkin> robkennedy: why cares?
01:40 <Welkin> who*
01:40 <Welkin> let them think whatever they want
01:40 <Welkin> they aren't even a programmer
01:41 unbalancedparen joined
01:41 <robkennedy> I care. I'd hope that the difference between Lisps and Haskell and python exists as more than historical accident.
01:44 <robkennedy> Moreover, the discrepancies I describe do exist - whether or not the object I've called Lisps correspond with actual Lisps, they do correspond to actual evaluation strategies.
01:45 Scip joined
01:48 {emptyset} joined
01:49 Jacoby6000 joined
01:50 mizu_no_oto joined
01:51 orphean joined
01:51 dreco joined
01:53 <boxscape> sometimes it feels like you should be able to do something like `(if p then x :) xs` instead of `if p then x : xs else xs`... although of course that doesn't make that much sense
01:53 <mikeplus64> anyone got ghc-vis (or equivalent) workong for ghc 8.0.2?
01:53 Juste joined
01:54 mkoenig joined
01:54 FreeBirdLjj joined
01:54 <robkennedy> boxscape: I use `(if p x then (x:) else id)` for those cases
01:54 <boxscape> robkennedy: ah, yeah, that doesn't look too bad
01:54 FreeBirdLjj joined
01:55 <geekosaur> if sections?
01:55 <boxscape> @pl \xs -> if p then x : xs else xs
01:55 <lambdabot> if' p =<< (x :)
01:55 <* geekosaur> wonders how badly that would mess up parsers :)
01:56 <boxscape> (if' p =<< (x :)) xs is actually visually speaking remarkably close to what I wrote above
01:56 dan_f joined
01:56 <robkennedy> : if'
01:56 <ExpHP> if you have a Maybe you can do maybe xs (:xs) x
01:56 <geekosaur> except if' doesn't exist as such
01:56 <geekosaur> there is bool through
01:56 <robkennedy> :t if'
01:56 <boxscape> right, I know
01:56 <lambdabot> error:
01:56 <lambdabot> • Variable not in scope: if'
01:56 <lambdabot> • Perhaps you meant ‘f'’ (imported from Debug.SimpleReflect)
01:56 <Welkin> seems like a useless extension
01:56 Juste left
01:56 j2j joined
01:56 <Welkin> this isn't code golf
01:57 <boxscape> Welkin: are you talking about if'?
01:57 <geekosaur> :t \p x xs -> bool (x:) id p xs
01:57 <lambdabot> Bool -> a -> [a] -> [a]
01:57 <Welkin> what is wrong with `if p then x : xs else xs`?
01:57 <Welkin> it's clear, short, and does what you expect
01:58 coltfred joined
01:58 <boxscape> well, sure, but it just kind of.. looks like you ought to be able to take out the xs. Nothing really wrong with it
01:59 systadmin joined
02:00 robertkennedy joined
02:00 hucksy_ joined
02:01 migimunz joined
02:01 <robertkennedy> You're right boxscape. What you want, from what I've seen, is `f p (x:xs) = (if p x then (x:) else id) $ f p xs`
02:01 <ExpHP> is there no languge extension for where clauses in do blocks?
02:02 <boxscape> robertkennedy: yeah, I can definitely see myself using something like that in a few cases
02:02 <robertkennedy> What I've written is filter, but it generalizes nicely.
02:02 <Cale> ExpHP: What would that look like?
02:02 <ExpHP> idunno, you tell me
02:02 <ExpHP> O:)
02:02 <robertkennedy> boxscape: yeah, I give that idiom as a Haskell user, not expert
02:03 <Cale> ExpHP: where clauses normally exist so that they can scope over multiple guards, but do-expressions don't have guards...
02:03 <robertkennedy> I've also used the idiom and felt wrong about it
02:03 <ExpHP> I just want something to scope over one line right now
02:03 <Cale> You can use let
02:04 <Cale> (or even let/in)
02:04 <boxscape> `where` is just desugared into `let ... in` anyway, so if you think you can do it with where, you ought to be able to do it with `let ... in`, especially if you don't have guards
02:04 <ExpHP> Cale: I can't quite picture where it would go: https://gist.github.com/ExpHP/38d5fc777d8b165fd2286c5db134358e
02:05 thunderrd joined
02:05 <ExpHP> er, that's also inside a do block
02:06 Jacoby6000 joined
02:06 <ExpHP> basically I don't want to disturb the margin for the first line
02:07 Kundry_Wag joined
02:08 systemfault joined
02:09 Goplat joined
02:09 tromp joined
02:09 <ExpHP> (updated gist to give slightly better idea)
02:11 <boxscape> ExpHP: I'm not sure if I have a good enough idea, but I still don't see why you couldn't just use `let` inside the do-Block in `act` instead of writing it into the where-Block
02:11 <robertkennedy> In the Vector documentation, they use `<1,2,3> :: Vector Int`. In SPJ's dph talks, he uses `[:1,2,3:] :: Array Int`. I've failed to use either syntax. How do I stop failing?
02:12 <ExpHP> boxscape, just because it's noisy
02:12 <ExpHP> boxscape: But perhaps I'm too picky
02:12 <boxscape> maybe if you write it with let and post it someone can suggest a way to make it less noisy, or maybe not, I don't know
02:13 tromp joined
02:13 <ExpHP> the thing is they're helper functions, and 'let' makes them look at a glance like they're values
02:13 urodna joined
02:14 mac10688 joined
02:14 <boxscape> functions *are* values :P
02:14 riaqn joined
02:14 riaqn joined
02:14 <ExpHP> I knew somebody would say that
02:14 <ExpHP> you know what I mean :P
02:14 <boxscape> alright, yeah, I know..
02:15 <ExpHP> of course I could also move them to global scope at the bottom of the file, but I also hate polluting the namespace
02:16 MarioBranco joined
02:16 <ExpHP> more local bindings = easier to see their purpose
02:16 <Cale> what do you want to define?
02:16 <lyxia> robertkennedy: I don't think you can actually use such notation.
02:16 <ExpHP> but again I guess I'm fretting over small details at this point
02:16 <Cale> Did you try just putting the definitions there?
02:16 <Cale> I think it'll work
02:17 <ExpHP> Cale of course I could; question isn't whether it will work, it's whether or not I'll enjoy reading the code later
02:17 <lyxia> robertkennedy: quasiquotes can get you somewhat close, you just don't get to choose the brackets
02:17 <ExpHP> "wtf is dquote"
02:17 <ExpHP> "oh there it is"
02:17 sanett joined
02:17 Xanather joined
02:17 <Cale> If it's within a few lines of where it's used, there won't be a problem no matter what you do
02:18 <ExpHP> Cale: if you mean the bottom of the file/end of the do block, that is hardly the full source code :P
02:18 <robertkennedy> lyxia: dang. How do you interact with dph? Vector.fromList isn't awful, but I can't figure out how to access `sumP`
02:19 <ExpHP> But anyways: There's really no language extension?
02:19 <* ExpHP> puppy dog eyes
02:19 <Cale> You want a where which does what?
02:20 <ExpHP> which can be attached to a line in a do block
02:20 <Cale> Scopes over an entire do-block?
02:20 <Cale> or, just one line?
02:20 <Cale> You can have a line which is
02:20 ramzifu joined
02:20 <Cale> let <decls> in <expr>
02:21 <lyxia> robertkennedy: Isn't sumP a repa thing
02:21 <ExpHP> > let in ()
02:21 <lambdabot> ()
02:21 takle joined
02:21 <Cale> lyxia: sumP was a dph thing before it was a repa thing. repa is sort of inspired by dph.
02:22 <Cale> Repa basically is dph but without the *nested* data parallelism.
02:22 <Cale> Well, and then with a bunch of other ideas layered on
02:22 <Cale> :)
02:22 data_hope joined
02:22 <ExpHP> > do { let in x where x = 3; }
02:22 exferenceBot joined
02:22 <lambdabot> <hint>:1:15: error: parse error on input ‘where’
02:22 <Cale> > do { let x = 3 in Just x }
02:23 <lambdabot> Just 3
02:23 <lyxia> Is that [:a:] notation actually a thing then?
02:23 <robertkennedy> Please say yes
02:23 peterbec` joined
02:23 <lyxia> robertkennedy: looks like there is a ParallelArrays extention
02:23 <Cale> Uhh, I don't know if they ever actually got it to the point of implementing the parallel array comprehension syntax
02:23 <Cale> maybe?
02:23 <ExpHP> > x where x = 3
02:23 <lambdabot> <hint>:1:3: error: parse error on input ‘where’
02:23 <ExpHP> ohhhhhhhh
02:24 <ExpHP> where's aren't attached to expressions, are they >_>
02:24 <boxscape> robertkennedy: and ParallelListComp
02:24 <lyxia> robertkennedy: Oh! Indeed this is enabled by ParallelArrays.
02:24 <robertkennedy> SPJ mentions in many talks to email him about use requests for DPH, but I get starstruck by MC Frontalot so I havent
02:25 sanett_ joined
02:25 <robertkennedy> lyxia: gold struck. Finally a reason to use -Odph over -O2?
02:25 <Cale> He's very friendly, and I'm sure he'd be interested to know that people are still interested in it.
02:25 <boxscape> ExpHP: in case you're interested, this page tells you exactly how `where` is translated into `let ... in` https://www.haskell.org/onlinereport/decls.html
02:26 mizu_no_oto joined
02:26 romeoh joined
02:26 <Cale> ExpHP: Yeah, where clauses are part of the syntax of declarations usually.
02:26 glguy_ joined
02:27 <Cale> Actually, I believe with one exception being that they're also part of the syntax of case expressions, so that you can have where clauses that scope over a bunch of the guards in a case expression (and have the bound variables in scope)
02:27 hexagoxel joined
02:28 <lyxia> robertkennedy: it's well hidden, the GHC user guide doesn't mention this extension, but says DPH is highly experimental and points to https://wiki.haskell.org/GHC/Data_Parallel_Haskell
02:28 <boxscape> Cale: I believe in `case` they are just part of the pattern binding, which makes them part of a declaration again
02:28 <Cale> https://www.haskell.org/onlinereport/exps.html#case
02:28 <ExpHP> thanks for the link boxscape
02:28 <Cale> The "where decls" there as part of the syntax of alternatives.
02:29 <boxscape> ah, yeah
02:29 e14 joined
02:29 <robertkennedy> lyxia: none of the source they mention compile with stack LTS that support ghc 8, and ApplicativeDo is too good to backtrack, unfortunately
02:29 juhp joined
02:30 <Cale> > case Just 5 of { Nothing -> 0; Just x | y > 10 -> y; otherwise -> y^2 where y = 2*x }
02:30 <lambdabot> y
02:30 <boxscape> but it's still part of the pattern binding, isn't it? at least if you look at it after the "shorthand" has been resolved
02:30 <Cale> oops!
02:30 <Cale> haha
02:30 <Cale> > case Just 5 of { Nothing -> 0; Just x | y > 10 -> y | otherwise -> y^2 where y = 2*x }
02:30 <lyxia> robertkennedy: 7.4 is quite old indeed
02:30 <lambdabot> 100
02:30 <boxscape> well, part of the match, I should say
02:30 <Cale> there we are
02:30 <Cale> used a ; where I wanted a |
02:31 <Cale> and y was in scope from lambdabot
02:31 <boxscape> > y
02:31 <lambdabot> y
02:31 <boxscape> > testing
02:31 <Cale> :t y
02:31 <lambdabot> error:
02:31 <lambdabot> • Variable not in scope: testing
02:31 <lambdabot> • Perhaps you meant one of these:
02:31 <lambdabot> Expr
02:31 <Cale> x + y + z
02:31 <Cale> > x + y + z
02:31 <lambdabot> x + y + z
02:31 <Cale> > x^6
02:31 <lambdabot> x * x * (x * x) * (x * x)
02:31 <boxscape> that's neat
02:31 <Welkin> lol
02:31 <boxscape> weird parenthesizing rules though
02:32 <Cale> Not so weird, it's associated like that -- (^) uses square and multiply
02:32 <boxscape> ah, ok
02:32 <robertkennedy> After SPJ, Philip​ Wadler, and the elusive Simon Marlow, who's talks should I turn to for study? Edward Kmett has great subject lectures, and I'm starting to study those. What names come to mind for Feynman-esque depth?
02:32 <robertkennedy> *whose
02:33 <Cale> robertkennedy: Do you have the specific SPJ video about pudding combinators? :D
02:33 <Cale> http://ulf.wiger.net/weblog/2008/02/29/simon-peyton-jones-composing-contracts-an-adventure-in-financial-engineering/
02:33 <robertkennedy> Pudding? Not yet, hyped to watch it!
02:34 conal joined
02:34 takle joined
02:35 Juste joined
02:35 eacameron joined
02:35 <robertkennedy> Oh shit at Clearwater Analytics, where I am our Haskell guy, this is the one paper I've seen global CC'd from the CTO who had never heard of Haskell
02:35 <ExpHP> "How to fit pudding in just 9 constructors"
02:35 strixy joined
02:35 FreeBirdLjj joined
02:35 <Cale> Conal Elliott, who just joined the channel, also has some rather good talks and demos :)
02:36 raycoll joined
02:36 <peddie> robertkennedy: Oleg Kiselyov http://okmij.org/ftp/
02:36 <Cale> https://www.youtube.com/watch?v=bmKYiUOEo2A -- perhaps this one? :)
02:36 mariano__ joined
02:36 e14 joined
02:36 <peddie> robertkennedy: actually I misread the question, Oleg does not have a lot of talks. but feynmanesque depth sounds like oleg papers to me
02:37 justicefries left
02:37 <conal> Cale: thanks for the plug
02:37 wayne joined
02:37 <Cale> :D
02:39 Juste left
02:40 <robertkennedy> peddie: sounds perfect to me. Simon Marlow lacks breath, but you can still take note of his hesitations etc
02:40 yogsotot_ joined
02:41 takle joined
02:42 <peddie> robertkennedy: have fun!
02:43 <Cale> What other really good talks... ah I remember really enjoying this talk by dcoutts on Cloud Haskell https://skillsmatter.com/skillscasts/3523-cloud-haskell
02:44 <robertkennedy> Cale: I'm a data analyst at a financial company, and this paper (contracts) is the basis for our developer orientation lecture
02:44 <Cale> Unfortunately, they've conveniently added a login wall since it went up, but accounts are free at least.
02:44 <Cale> I might also plug my own boss' talk about reflex and reflex-dom :) https://www.youtube.com/watch?v=dOy7zIk3IUI
02:47 mizu_no_oto joined
02:47 <robertkennedy> I like skillsmatter. Speaking of which, is the London LambdaCon hype? What are your most hyped Haskell conventions?
02:48 <Welkin> lambdaconf and strange loop?
02:49 migimunz joined
02:49 <Welkin> there is some kind of developer conference happening in my city this week, but it's all .net and microsoft crap o.o
02:53 nekomune joined
02:55 j2j joined
02:56 xtreak joined
02:57 <Cale> O
02:57 <Cale> oops
02:57 FreeBirdLjj joined
02:58 fakenerd joined
03:01 diminishedprime joined
03:01 <Cale> I haven't been to so many different things yet. I went to Compose, and that was fun. Also, the Boston Hackathon, which was pretty laid back and I had a lot of good chats there.
03:02 <Cale> I'm considering attending BayHac coming up right now
03:03 Autolycus joined
03:03 <Cale> I'd originally had a plan to go visit a friend in Melbourne a while back, and that fell through. Maybe if we're able to resuscitate that plan, I can connect through BayHac to Melbourne, and then attend LambdaJam in Sydney on my way back in May :D
03:06 lifter joined
03:08 Kundry_Wag joined
03:09 takle joined
03:09 zcourts joined
03:09 Koterpillar joined
03:10 <boxscape> > x^y -- why does this happen?
03:10 <lambdabot> mueval-core: Time limit exceeded
03:11 gugah joined
03:11 <Koterpillar> :t x
03:11 <lambdabot> Expr
03:12 dan_f joined
03:13 alx741_ joined
03:14 lifter joined
03:14 Jesin joined
03:15 splanch joined
03:15 gsingh93 joined
03:16 n__dles joined
03:16 cyborg-one joined
03:16 vishesh joined
03:17 nak joined
03:18 <glguy> :t (^)
03:18 <lambdabot> (Num a, Integral b) => a -> b -> a
03:19 zcourts joined
03:19 <glguy> http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Real.html#%5E
03:19 <glguy> Expr has a bunch of bogus instances that are handy for the simplest cases
03:20 <glguy> But in the case of (^) the instances result in evaluation never completing
03:20 locallycompact joined
03:20 <glguy> > (10 < x, x < y, y > x)
03:20 <lambdabot> (True,True,True)
03:21 <glguy> It's useful for simple examples like:
03:21 <glguy> > sum [x,y,z]
03:21 <lambdabot> 0 + x + y + z
03:22 <glguy> > S.fromList [x,y,z,x,y,z]
03:22 <lambdabot> fromList [x,y,z]
03:22 takle joined
03:22 nocookies92 joined
03:23 <Cale> > foldr f z [1,2,3]
03:23 <lambdabot> f 1 (f 2 (f 3 z))
03:23 emerson joined
03:23 eazar001 joined
03:24 <boxscape> hm, I see
03:24 peterbec` joined
03:24 <boxscape> > take x [1..5]
03:24 <lambdabot> error:
03:24 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘Expr’
03:24 <lambdabot> • In the first argument of ‘take’, namely ‘x’
03:25 <boxscape> that does make sense as well
03:25 <Cale> Yeah, you can't actually do anything which meaningfully relies on the value of the variables.
03:25 <Cale> They're just glorified strings with a bunch of instances
03:25 <Cale> The function-y ones are a bit more than that, but not by too much
03:25 <Cale> :t f
03:25 <lambdabot> FromExpr a => a
03:25 <Cale> :t f :: Expr -> Expr
03:26 <lambdabot> Expr -> Expr
03:26 <Cale> > f x
03:26 <lambdabot> error:
03:26 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M670384748145...
03:26 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
03:26 <Cale> > f x :: Expr
03:26 <lambdabot> f x
03:27 <boxscape> oh, different letters have different types?
03:27 <boxscape> :t o
03:27 <lambdabot> error:
03:27 <lambdabot> Ambiguous occurrence ‘o’
03:27 <lambdabot> It could refer to either ‘Debug.SimpleReflect.o’,
03:27 <Cale> iirc, f, g, h were the generalised ones
03:27 <Cale> :t o
03:27 <lambdabot> error:
03:27 <lambdabot> Ambiguous occurrence ‘o’
03:27 <lambdabot> It could refer to either ‘Debug.SimpleReflect.o’,
03:27 <Cale> oh
03:27 <Cale> hah
03:27 <Cale> :t s
03:27 <lambdabot> Expr
03:27 <boxscape> ok
03:27 eacameron joined
03:31 safe joined
03:32 afnizarnur joined
03:34 felixsch_ joined
03:34 carlosda1 joined
03:36 robkennedy joined
03:38 <boxscape> > reduction (1+2*(3+4)) -- the package is pretty neat in general
03:38 <lambdabot> [1 + 2 * (3 + 4),1 + 2 * 7,1 + 14,15]
03:39 zcourts_ joined
03:40 migimunz joined
03:44 neonfuz joined
03:45 zcourts joined
03:46 jamiis joined
03:48 darjeeling_ joined
03:48 sanett joined
03:48 vaibhavsagar joined
03:49 takle joined
03:49 alx741 joined
03:49 splanch joined
03:50 FreeBirdLjj joined
03:50 zcourts_ joined
03:51 conal joined
03:52 sanett joined
03:53 otto_s joined
03:55 halogenandtoast joined
03:56 sanett joined
03:57 bryanlemon joined
03:57 splanch joined
03:57 sanett joined
03:59 zcourts joined
04:00 migimunz joined
04:03 fizruk joined
04:03 bbcue joined
04:03 Jacoby6000 joined
04:05 sanett_ joined
04:06 <halogenandtoast> Is there a nicer way to do: if x `elem` xs then x else '_'
04:06 alex-shpilkin joined
04:06 yogsotot_ joined
04:06 Gurkenglas_ joined
04:07 sellout- joined
04:09 sanett joined
04:09 alex-shpilkin joined
04:10 takle joined
04:10 CurryWurst joined
04:10 AppleJacks24 joined
04:10 da-x joined
04:12 FreeBird_ joined
04:13 sdrodge joined
04:14 afnizarnur joined
04:14 zcourts_ joined
04:19 Autolycus joined
04:19 <[k-_> maybe '_' id (find x xs) or bool '_' x (x `elem` xs)
04:20 takle joined
04:20 <[k-_> or fromMaybe '_' (find x xs)
04:21 <[k-_> oh, oops I remembered the type signature of find wrongly :p
04:21 ramzifu joined
04:23 <[k-_> i think the way you did it would be the best way
04:23 gspia joined
04:23 burtons joined
04:25 peterbec` joined
04:26 data_hope joined
04:27 halogenandtoast joined
04:29 takle joined
04:32 dreco joined
04:33 zcourts joined
04:34 eklavya joined
04:34 ichor joined
04:35 shayan_ joined
04:36 sleffy joined
04:36 fakenerd joined
04:37 takle joined
04:37 _sras_ joined
04:39 isidore joined
04:39 <_sras_> What are the compiler options that can help to reduce the size of the resulting executable?
04:39 mda1 joined
04:39 eklavya_ joined
04:42 FreeBirdLjj joined
04:42 yogsotot_ joined
04:42 <jle`> halogenandtoast: hangman game? :)
04:42 vlatkoB joined
04:43 <srhb> _sras_: I don't know of any that don't change the functionality. you could strip the executable afterwards though.
04:43 <srhb> "Don't change functionality" -- as in static vs dynamic.
04:46 <halogenandtoast> jle`: How did you guess?
04:46 <halogenandtoast> The '_' gave it away?
04:46 <jle`> it's the whole function
04:46 <jle`> i've written it countless times but only for my many hangman re-implementations lol
04:47 <Cale> -fno-code is pretty good at reducing size ;)
04:47 <halogenandtoast> jle`: yeah that's fair
04:47 <halogenandtoast> checking the logs for the answers
04:47 <jle`> i also assign hangman as a homework assignment so i see it a lot too :)
04:48 <halogenandtoast> Yeah I assigned it as "homework" for ruby
04:48 <halogenandtoast> and decided to write it in Haskell
04:48 <jle`> hangman is a project i recommend a lot for haskell because it's something that you can write so many different ways
04:48 <jle`> once you learn more concepts
04:49 <jle`> so if you implement it one way now, it's likely that you'll do it another way in a few months
04:49 <halogenandtoast> jle`: True, here is my first pass: https://gist.github.com/halogenandtoast/86675d429b918fc70db6bb2778a17d7e
04:49 xall joined
04:49 takle joined
04:50 <jle`> nice :)
04:51 Koterpillar joined
04:51 augur joined
04:51 <halogenandtoast> Thanks
04:51 <halogenandtoast> I'm sure there are things I could do better
04:51 event_null joined
04:52 <halogenandtoast> but it's simple enough
04:52 <jle`> it's already pretty clean :)
04:52 <jle`> the classic recursive game loop
04:53 <halogenandtoast> Yeah that's my go to.
04:53 <halogenandtoast> A few of the patterns in here I reuse a lot
04:53 <halogenandtoast> For instance in almost all my command line games, I implement `ask`
04:53 armyriad joined
04:54 <halogenandtoast> And I often do main = getArgs >>= run
04:54 <halogenandtoast> to pattern match on args nicely
04:55 fakenerd joined
04:55 <jle`> you can learn a lot about someone by looking at how they implement hangman
04:56 NeverDie joined
04:56 <jle`> reminds me of https://www.willamette.edu/~fruehr/haskell/evolution.html
04:57 takle joined
04:58 brynedwardz joined
04:58 arctictern joined
04:58 <halogenandtoast> Ha, yeah, I sometimes wonder which category I fall in.
05:00 xtreak_ joined
05:01 <johnw> halogenandtoast: one with identity and composition, I hope
05:02 Destol joined
05:03 vinskystra joined
05:04 <vinskystra> anyone here? what book do you reccommend, I have experience in C
05:04 <vinskystra> and also python, but not in the OOP aspects of it
05:04 <Cale> _sras_: But more seriously, try asking around in #ghc for help with code size. There were some issues we were having with code size, and -- well, I hesitate a little to comment on this because I was only overhearing things that were going on -- but it sounded like some stuff related to removal of dead code wasn't working quite as intended.
05:04 <kadoban> vinskystra: Thankfully, lack of OO experience probably won't matter. I like http://haskellbook.com/ a lot
05:05 <jle`> the more OOP experience you have, the harder time you'll have learning haskell
05:05 <_sras_> Cale: It is not a big deal. Just checking if there is some "low hanging stuff" regarding this...
05:05 HappyEnte_ joined
05:05 stefan joined
05:05 spacebug_ joined
05:06 <halogenandtoast> jle`: I don't think that has to be a true statement
05:06 kmic joined
05:06 <jle`> i suppose it's not strictly monotonic
05:06 madsj_ joined
05:06 <halogenandtoast> But I came from OOP and had a hard time at first
05:07 <halogenandtoast> but that's because I focused too much on trivial things
05:07 <halogenandtoast> like Monads
05:07 solution1 joined
05:07 anry_ joined
05:07 folsen_ joined
05:07 froztbyt1 joined
05:07 spatial joined
05:07 dec0n joined
05:07 Ov3rload joined
05:07 <Cale> _sras_: For us, it was temporarily a big deal, as it had to do with code size limits on Apple's iOS app store -- we sidestepped the issue by figuring out how to increase the version number on some things in order to qualify for a newer limit.
05:07 garphyx joined
05:07 eklavya joined
05:07 <vinskystra> thanks a lot!
05:08 <Cale> _sras_: but ultimately we'd like to get the actual issue fixed :P
05:08 <spatial> http://lpaste.net/354050 Converting this to haskell. How many loops are there ? Anyone can explain ?
05:08 splanch joined
05:09 <spatial> I am not a lisp coder
05:09 <jle`> i am not a lisping man, but ctrl+f loop reveals 4 matches
05:10 yogsotot_ joined
05:10 <spatial> I mean I understand haskell and just converted a 300 line lisp program to haskell. Wasn't too difficult. Just asking.
05:10 Kundry_Wag joined
05:11 splanch_ joined
05:11 {emptyset} joined
05:11 <spatial> There is a loop in finally ?
05:11 <Cale> I would normally be able to help you, but the presence of the loop macro means I would have to guess a little at what the code means. Some Common Lispers really love it, but I always avoided that thing.
05:12 <spatial> finally is called after the repeat and first loop finishes. Right ?
05:13 <Cale> http://www.lispworks.com/documentation/lw51/CLHS/Body/06_a.htm might be helpful...
05:14 <spatial> Can't I just add a last statement at the end instead of finally ?
05:14 uglyfigurine joined
05:15 takle joined
05:16 <Cale> I think finally is meant to be what happens once the loop is about to complete, but with all the stuff that's initialised by the loop still in scope
05:16 jhrcek joined
05:16 sleffy joined
05:17 <Cale> For example here you have that array which is brought into scope by the loop construct, so you can't do what you're doing in the finally after the loop, because that would no longer be available.
05:17 <spatial> Yes. I use Java finally. Any other easy lisp to replace that ?
05:17 enitiz joined
05:18 <spatial> Cale: I will read that link too.
05:20 spatial_ joined
05:20 <spatial_> Any equivalent of finally in lisp ?
05:20 <spatial_> Converting some lisp.
05:20 <spatial_> I mean in haskell.
05:20 zcourts joined
05:21 sgript joined
05:21 <Cale> Uh, well, Haskell doesn't have anything remotely like the loop macro. You'd have to translate the intent of the code.
05:21 eagleflo joined
05:21 robogoat joined
05:22 <Cale> (well, it could if someone was crazy enough to implement something like it using Template Haskell, but that's unlikely)
05:22 <spatial> Let me try.
05:22 <Cale> Anyway, it just means you need to do some extra stuff at the end of the loop
05:23 tomboy64 joined
05:23 takle joined
05:24 <Cale> I don't really know what this code is meant to compute, so it's hard to offer suggestions about how to translate it
05:25 meandi_2 joined
05:26 peterbec` joined
05:27 windsing joined
05:27 augur joined
05:28 osa1 joined
05:31 augur joined
05:33 Bigcheese joined
05:33 danvet joined
05:34 mbuf joined
05:35 zariuq joined
05:35 carlosda1 joined
05:35 JoshS joined
05:35 mavihs joined
05:35 mavihs joined
05:35 zcourts joined
05:36 m0rphism joined
05:37 locallycompact joined
05:37 nahra` joined
05:39 noctux` joined
05:39 gpampara- joined
05:39 Ov3rload joined
05:39 scared1 joined
05:42 Xanather joined
05:44 takle joined
05:44 animated joined
05:47 thimoteus joined
05:47 serendependy joined
05:48 zcourts joined
05:52 lavalike joined
05:53 unK_ joined
05:54 tromp joined
05:55 permegreen joined
05:56 ByronJohnson joined
05:56 nilOps joined
05:56 a3Dman joined
05:56 a3Dman joined
05:57 heurist joined
05:57 luis joined
05:57 madacol joined
05:58 ThomasLocke joined
05:58 takle joined
05:59 dunx joined
05:59 <spatial> When is init called in http://lpaste.net/354050 ? For every repeat ?
05:59 ogrady joined
06:00 haskell1990 joined
06:00 <spatial> Oh Intended for lispers
06:01 Luna521 joined
06:03 juhp joined
06:03 b_perez joined
06:03 <b_perez> #haskell
06:04 b_perez joined
06:04 Swizec joined
06:05 tsahyt joined
06:06 sheaf joined
06:07 <b_perez> Hi all, first time on this channel. I've been messing around with the ghc api and am trying to use it to parse a haskell program and get type info about various expressions in this parsed program. Any tips? The api has been sorta hard to get into
06:07 bbcue joined
06:08 Reshi joined
06:10 dfeuer joined
06:11 edsko joined
06:11 Kundry_Wag joined
06:12 zcourts joined
06:12 hurkan joined
06:13 dawehner joined
06:14 <geekosaur> it is difficult, yes. there are examples out there (see for example ghc-mod and intero), and also some simplified interfaces that may be sufficient for some use cases (see for example the hint package)
06:14 sanett joined
06:15 raichoo joined
06:17 <b_perez> thanks! hint looks really nice. I'm basically trying to parse a program and modify all expressions in the program with a certain type.
06:18 MoALTz joined
06:20 xtreak joined
06:22 <cocreature> b_perez: you might also be interested in ghc-exactprint, in particular, https://hackage.haskell.org/package/ghc-exactprint-0.5.3.0/docs/Language-Haskell-GHC-ExactPrint.html#v:parseModule.
06:22 vektorweg11 joined
06:26 xtreak joined
06:27 Sose joined
06:27 peterbec` joined
06:28 data_hope joined
06:28 halogenandtoast joined
06:29 kritzcreek_ joined
06:29 permagreen joined
06:30 spatial joined
06:31 <spatial> Parse error at 2nd 'where' http://lpaste.net/354051. What could be wrong ?
06:31 Koterpillar joined
06:31 <spatial> Don't see any other error in spacemacs.
06:32 zcourts joined
06:32 henriksod joined
06:33 magthe joined
06:34 xtreak joined
06:35 <cocreature> spatial: you can only use "where" on a definition and the call to "loop1" is not a definition
06:35 <cocreature> definition meaning something with an equality sign in between :)
06:36 sanett_ joined
06:36 alfredo joined
06:36 <cocreature> spatial: you can use a "where" clause on the definition of "loop"
06:37 <cocreature> or use "let"
06:37 zargoertzel joined
06:37 <spatial> I was trying to define another nested function.
06:38 <cocreature> you can nest it by putting it on the definition of "loop"
06:38 govg joined
06:38 <cocreature> you can’t nest it inside the first guard
06:38 Itkovian joined
06:39 <spatial> Sorry. Didn't get.
06:39 <cocreature> let me make an example
06:39 <spatial> You mean loop1 has to be defined beforehand.
06:40 <lpaste_> cocreature annotated “No title” with “No title (annotation)” at http://lpaste.net/354051#a354052
06:41 KarboniteKream joined
06:41 <spatial> Ok. Thanks.
06:42 _sg joined
06:42 <cocreature> spatial: arguably you should split up your definition into multiple clearly separated top-level definitions once you reach that level of nesting but that’s a matter of taste
06:42 laz joined
06:43 nick2000 joined
06:44 <spatial> cocreature: Should be more functional. Yes
06:44 patbecich joined
06:44 connrs joined
06:46 ubsan_ joined
06:46 eacameron joined
06:48 ramzifu joined
06:48 yellowj joined
06:48 Juste joined
06:49 Juste left
06:50 eacamero_ joined
06:50 takle joined
06:51 bsmt joined
06:52 <Gurkenglas_> (Warning: Code golf. Had not expected that eta-reducing f would make a difference in the runtime there http://lpaste.net/2677038667326816256 )
06:52 <Gurkenglas_> (After all f is only called like 15 times with the provided inputs)
06:54 refold joined
06:54 robertkennedy joined
06:54 patbecich joined
06:55 Juste joined
06:56 <arctictern> Hey guys, newcomer here. I have a few questions about stack if anyone cares to answer
06:56 dawehner joined
06:56 <arctictern> Long story short, when I setup a new stack project and try to do "import Data.List.Split", stack build fails with the following error: Failed to load interface for ‘Data.List.Split’
06:56 <arctictern> It is a member of the hidden package ‘split-0.2.3.1’.
06:58 <arctictern> This is w/o modifying stack.yaml or myproject.cabal. I can get it to work by adding extra dependencies to those files, but I'm confused as to why that's necessary. It looks like the snapshot I'm using (8.6) has the Data.List.Split module. So why should I need to explicitly add it to my config?
06:58 <opqdonut> arctictern: you don't need to add it to stack.yaml, but you do need to add it to myproject.cabal
06:58 <geekosaur> yes, because anything not specified is hidden. you can have multiple versions of packages, or packages that export the same module namespace
06:58 <hvr> arctictern: because stack.yaml is a project config
06:58 <hvr> arctictern: while myproject.cabal is actually a package config
06:59 <opqdonut> arctictern: stack defines which packages are available in the sense that can be used. cabal defines which packages are visible in your project
06:59 zeroed joined
06:59 zeroed joined
06:59 mattyw joined
06:59 <geekosaur> so you must specify what packages (and ideally versions) provide the ones you want to use
06:59 <arctictern> Ok that makes sense
06:59 takle joined
07:00 <arctictern> If I do "import Data.List" though, i don't have to specify it
07:00 data_hope joined
07:00 <arctictern> and that's not in base right
07:00 <hvr> arctictern: and fwiw, it's only stack that requires you to define packages twice; in cabal you also have the equivalent of a stack.yaml file; it's called cabal.project there; but there you don't have to redundantly specify packages
07:00 <hvr> arctictern: Data.List *is* in base
07:00 guiben joined
07:01 <arctictern> Ah sorry. Got confused between base and prelude
07:01 splanch joined
07:01 <arctictern> Thanks guys!
07:02 <opqdonut> hvr: you don't need to mention pacakges that are in your resolver in the stack.yaml file
07:02 <hvr> opqdonut: you still have to mention them via the resolver
07:02 nick_h joined
07:02 <hvr> opqdonut: even though your .cabal file is supposed to specify version bounds
07:02 <opqdonut> well, yeah
07:02 razi1 joined
07:03 <opqdonut> if you don't want snapshots don't use stack?
07:03 <opqdonut> err resolvers
07:03 <hvr> you can use stack w/o any resolver? :-)
07:03 raichoo joined
07:03 dawehner joined
07:04 <opqdonut> it's easy! just say "cabal build" instead of "stack build" ;)
07:04 <arctictern> Quick followup... when I do "ghc-mod check test.hs" outside of a stack project, what directory/ies are looked at to check for supported packages
07:04 Koterpillar joined
07:04 <hvr> heh
07:04 <hvr> opqdonut: at this point, I'd rather say 'cabal new-build' :-)
07:04 <opqdonut> fair enough
07:05 baldrick1 joined
07:05 <arctictern> For example, if I have "import Data.List.Split" in a test.hs, and do "ghc-mod check test.hs", it gives the "Failed to load..." error. Running "stack install split" doesn't fix the error (doesn't affect global packages?) but "cabal install split" does
07:05 <arctictern> Does that mean I have to install packages with cabal if I want them to be visible to ghc-mod in any given situation?
07:06 <opqdonut> arctictern: you need to run ghc-mod inside the stack environment
07:06 slomo joined
07:06 <geekosaur> ghc-mod only knows what ghc itself does. stack and cabal both pass ghc extra information, but don't know how to do that for ghc-mod
07:06 bbcue joined
07:06 <hvr> arctictern: 'stack install' installs into some stack sandbox iirc
07:06 <geekosaur> except via {cabal|stack} exec
07:06 thc202 joined
07:06 <arctictern> Yea if I run ghc-mod inside the stack environment, it works. But for standalone haskell files, is cabal install necessary?
07:06 albertid joined
07:07 <geekosaur> yes, because that's the only way a standalone ghc will find them
07:07 <hvr> arctictern: yeah, `cabal install` allows you to manage your 'user pkg db' which e.g. `ghc-pkg list` allows you to list
07:07 takle joined
07:07 <hvr> arctictern: and which is seen by ghc/ghci et all by default
07:07 <geekosaur> ghc is not aware of either cabal or stack sandboxes, it's just a compiler not a project manager
07:07 leat joined
07:08 takuan joined
07:08 <hvr> geekosaur: to be fair; we have a mechanism in the works that was created for the sake of the the nix-style cabal mode: ghc envs; but there's some issues blocking it
07:08 quchen joined
07:08 raichoo joined
07:08 <arctictern> Gotcha, thanks again
07:09 sanett joined
07:10 guiben joined
07:12 jsgrant joined
07:12 biglama joined
07:12 Kundry_Wag joined
07:13 jsgrant-_ joined
07:14 Grisha_ joined
07:15 ventonegro joined
07:15 vlatkoB joined
07:16 BartAdv joined
07:17 grayjoc joined
07:18 Juste1 joined
07:18 nlvkjq joined
07:19 jmorris joined
07:19 jgertm joined
07:23 OnkelTem joined
07:25 uglyfigurine joined
07:28 peterbec` joined
07:29 Salih joined
07:29 ragepandemic joined
07:29 MindlessDrone joined
07:30 arctictern joined
07:31 tomkerk[m] joined
07:31 KarboniteKream joined
07:31 arctictern joined
07:32 salva0 joined
07:32 arctictern joined
07:33 arctictern joined
07:33 megaTherion joined
07:33 Juste1 left
07:34 arctictern joined
07:34 Juste1 joined
07:35 eacameron joined
07:35 carlosda1 joined
07:36 augur joined
07:37 bjz joined
07:40 systadmin joined
07:41 leat joined
07:43 jmiven joined
07:45 merijn joined
07:46 ramzifu joined
07:46 mszczygiel joined
07:50 connrs joined
07:52 systadmin joined
07:52 takle joined
07:53 igniting joined
07:55 systadmin joined
07:55 tromp joined
07:56 yogsotot_ joined
07:56 patbecich joined
07:56 yogsotot_ joined
07:59 KarboniteKream joined
07:59 selthas1 joined
08:01 detrumi joined
08:01 benjamin2 joined
08:02 B1ackMamba joined
08:02 B1ackMamba left
08:03 selthas joined
08:03 splanch joined
08:06 <reactormonk> I'm trying to understand the Monad instance of Free Monad, and I think it would help to have every piece of the Monad instance description annotated - is there a tool for that?
08:06 xall joined
08:07 KarboniteKream joined
08:08 splanch joined
08:08 <jle`> annotated in what way
08:08 <jle`> with comments?
08:09 nmattia joined
08:09 lep-delete joined
08:09 <reactormonk> jle`, or inline types via :: - both would work.
08:11 arpl joined
08:11 <merijn> Honestly, Free is just a rose tree generalised to any functor
08:11 salva0 joined
08:11 <merijn> reactormonk: Are you familiar with Rose trees?
08:12 <merijn> "data RoseTree a = Tree [RoseTree a] | Leaf a"
08:12 <merijn> Replace [] with any functor:
08:12 <merijn> "data RoseTree f a = Tree (f (RoseTree a)) | Leaf a"
08:13 marr joined
08:13 <merijn> eh
08:13 <jle`> reactormonk: i do not know of any such tool, but it sounds like something that might be useful. for what it's worth, the core language used during haskell compilation (that you can dump) always explicitly specifies the types of all of the polymorphic functions it uses
08:13 Kundry_Wag joined
08:13 <merijn> "data RoseTree f a = Tree (f (RoseTree f a)) | Leaf a" obviously
08:13 takle joined
08:13 <merijn> Which with a little renaming is:
08:13 <merijn> "data Free f a = Free (f (Free f a)) | Pure a
08:14 <merijn> Not sure if that helps understanding the Monad instance, though :)
08:14 hhf joined
08:14 bshelden joined
08:15 <jle`> maybe it's easier to understand it through join?
08:15 <jle`> hm perhaps not easier, but it's an alternative way.
08:16 <merijn> Well, for me, the monad instance of Free was easy as "generalised rose tree + monads are trees with grafting" (which explains the monad instance of trees)
08:16 <reactormonk> jle`, mainly about the (fmap (>>= free) fun) part
08:16 <merijn> reactormonk: https://dl.dropboxusercontent.com/u/828035/Monads/monads.pdf
08:16 <jle`> i wonder if looking at the core dump would help at all
08:16 <jle`> because the core dump explicitly gives the types it is using for >>= and fmap etc.
08:16 <merijn> reactormonk: Do you understand my generalisation of RoseTree?
08:18 <merijn> reactormonk: Where is that "(fmap (>>= free) fun)" from?
08:18 armyriad joined
08:18 <jle`> reactormonk: if you mean `Free m >>= f = Free (fmap (>>= f) m)`
08:18 <lpaste_> merijn pasted “Free from free package” at http://lpaste.net/354053
08:19 splanch joined
08:19 <merijn> That looks fairly straightforward?
08:19 <jle`> i think they're not sure what instance of Functor is being used for <$>/fmap, and what instance of Monad is being used for the >>= in (>>= f)
08:20 <cocreature> reactormonk: I often replace expressions by _ to see t
08:20 <cocreature> he type ghc expects
08:20 <merijn> reactormonk: Note that the contents of "Free" are "f (Free f a)" <- for some Functor 'f'
08:21 <merijn> reactormonk: To apply ">>= f" to every 'Free f a' inside the functor you need to 'fmap' it into 'f'
08:21 mekeor joined
08:21 MindlessDrone joined
08:22 quchen_ joined
08:22 <merijn> reactormonk: Actually, here's an exercise: Take my "data RoseTree a = Tree [RoseTree a] | Leaf a" and implement a monad instance for it
08:23 <merijn> That's a crucial first step
08:23 inad922 joined
08:24 cfricke joined
08:24 tomphp joined
08:25 <merijn> And if you get stuck doing that, refer to the link a few lines back of the "Monads are Trees with Grafting" paper, which explains the monad instance of trees :)
08:27 halogenandtoast joined
08:29 mattyw joined
08:29 peterbec` joined
08:29 Glooomy joined
08:30 <Myrl-saki> " Using partially-defined values, we show that the standard lazy and strict implementations of the state monad do not satisfy the expected laws.
08:30 <Myrl-saki> What is partially-defined?
08:30 <Myrl-saki> `(undefined, "x")` ?
08:31 <merijn> Myrl-saki: Yup
08:31 <jle`> are there any monad instances in haskell that actually satisfy the monad laws
08:31 <merijn> Some people argue monad laws should preserve definedness (whether something is bottom or not)
08:31 <merijn> Other people argue:
08:32 <merijn> "Fast and Loose Reasoning is Morally Correct" REEEEEEEEEEEEEEEEEE
08:32 takle joined
08:32 <merijn> Relevant paper: https://pdfs.semanticscholar.org/a316/3d9097a87a713f0dd3f154f139e19dcb2a82.pdf
08:33 <merijn> Which boils down to "we often pretend our non-total language is actually total and here we give a mathematical argument why that's actually a perfectly reasonable thing to do"
08:34 oish joined
08:34 juhp joined
08:34 eacameron joined
08:34 erisco joined
08:34 tomphp joined
08:37 plutoniix joined
08:37 roundhouse joined
08:42 ktonga joined
08:43 benl23 joined
08:43 <reactormonk> merijn, it's from https://gist.github.com/6503271cc209ceaa8df2cc83eb0c8162
08:43 jophish joined
08:44 <reactormonk> merijn, I don't have a concept of the rose tree :-/
08:44 <reactormonk> cocreature, ah, nice trick.
08:44 sanett joined
08:45 <reactormonk> jle`, yeah, I do.
08:45 <merijn> reactormonk: rose tree is just a tree with "any number of leafs" rather than a binary tree, which only has two leaves
08:45 <jle`> not even Identity is a lawful monad if you consider bottom
08:45 <jle`> if we don't have identity then what do we even have
08:46 <merijn> jle`: It is if you use the newtype ;)
08:46 Wizek_ joined
08:48 <ktonga> hey fellas, I know some haskell and now my next step is to get better on real-world haskell, and for that I had this idea of rewriting in haskell the current project I'm working on at $JOB using scala, can't imagine something more real world than that
08:48 benjamin2 joined
08:48 <ktonga> But the thing is I've implemented it mainly with pure FP patterns when possible but for a few things I dunno how to implement in FP I used actors, despite the fact I dont love them, I have to admit it was pretty easy to use them for solving this particular problem.
08:49 <ktonga> Here it is the main problem this project tries to solve: at $JOB we depend on a really shitty chat platform that exposes a polling based rest API, so the main flow is to periodically check for new chats, if any is detected add it to a list of managed chats and start checking for new events like system notifications or visitor text lines. The idea is to hide all that complexity in this app and push the proper events to downstream systems using webhooks. I've
08:49 <ktonga> used two actors for that, one chats manager that does the chats discovering and it manages children actors which each represents a chat doing the event polling and the push to the webhook.
08:49 <ktonga> How would you do that in haskell?
08:50 <cocreature> ktonga: you can just use one Haskell thread for each actor
08:50 <cocreature> ktonga: Haskell has light-weight threads so performance should not be an issue
08:50 <ktonga> TBH I'm not worried about perf ATM
08:51 <ktonga> just on learning the right way in haskell
08:51 zero_byte joined
08:52 <reactormonk> jle`, ... welcome to scala
08:52 govg joined
08:52 freusque joined
08:53 <jle`> merijn: i remember a discussion a year or so on this channel about how the Monad instance for Identity in base was broken...but i can't find the counter-example anymore v.v
08:53 <jle`> reactormonk: warm welcome :)
08:54 mjolnir joined
08:54 <ktonga> cocreature: so actors are like threads but the selling point is that they are even lighter and with better concurrency warranties
08:55 Jacoby6000 joined
08:55 ub joined
08:55 <cocreature> ktonga: they are lighter than OS threads, I doubt they are significantly lighter than Haskell threads. I’m not sure what you mean by “better concurrency warranties”
08:55 <ktonga> I have a rough idea of how I could do it using FS2 that is an streaming lib in scala
08:56 takle joined
08:56 tromp joined
08:56 <merijn> I doubt actors are more lightweight than Haskell threads
08:56 <merijn> Even Erlang processes weigh more than Haskell threads
08:56 <ktonga> nvm, I'm not defending them, I'd prefer to avoid using any similar solution, I was more looking for a less mutable-ish solution
08:56 sanett_ joined
08:57 cyborg-one joined
08:57 <merijn> If actors are a good fit, then so are Haskell threads :)
08:57 <merijn> But then, like 80% of my haskell code tends to be lots of threads and IO and very little immutable :p
08:57 <cocreature> I don’t think threads are worth avoiding
08:57 patbecich joined
08:58 <jle`> haskell makes threads fun again
08:58 <cocreature> you can have your pure logic run inside of each thread
08:58 <merijn> jle`: s/ again//
08:58 <ktonga> :)
08:58 <jle`> s/again//
08:58 <jle`> heh
08:58 <cocreature> but using threads to structure concurrent logic is completely fine
08:59 <ktonga> ok sounds good, I'll need to read more about them, is one of many things I've never tried i haskell :)
09:00 <ktonga> so raw threads is the way to go? or there is some abstraction there that I sould be aware of?
09:00 <merijn> @ask phadej I see you committing to 'bound' on github and I notice the bounds on the github version are newer (i.e. actually work for me), any plans to release a new version soonish?
09:00 <lambdabot> Consider it noted.
09:00 <merijn> ktonga: Have a look at the modules in Control.Concurrent
09:00 Jacoby6000 joined
09:00 <merijn> ktonga: Which give you "forkIO :: IO () -> IO ThreadId" for spawning threads and lots of tools like semaphores, channels, etc. Also have a look at STM
09:01 balor joined
09:02 <ktonga> ok, sounds like a lot of work (nice one) already. I think I have something to start with. Will come back with more questions for sure once I start :)
09:03 puregreen joined
09:04 carlosda1 joined
09:05 <ktonga> I have been also recommended to take a look at cloud haskell so I'll check both. it's alway good to have options
09:05 ngWalrus left
09:05 inad922 joined
09:06 takle joined
09:07 <cocreature> ktonga: you might also be interested in http://chimera.labs.oreilly.com/books/1230000000929/index.html in particular the second part on concurrent haskell
09:07 vjit joined
09:07 <ertes> helo
09:08 <ktonga> cocreature: cool, thanks a lot
09:09 mohsen_ joined
09:10 gillesmajor joined
09:11 gillesmajor left
09:11 louispan joined
09:11 mutablemonkey joined
09:11 <mutablemonkey> Hi
09:11 <mutablemonkey> My name is mutable monkey and I am looking for papers about immutable programming and arguments against why statefulness is bad.
09:12 <ertes> mutablemonkey: statefulness isn't bad, mutable state is (often) bad
09:12 <mutablemonkey> Fair point, my friend.
09:13 <mutablemonkey> I would like to know more about that, and things that I can reference.
09:14 Kundry_Wag joined
09:15 ebzzry joined
09:15 eacameron joined
09:15 <ertes> to convince yourself or others?
09:15 <roundhouse> hi, if I have a StateMonad with a State `data S = A a | B b`, I'd like to zoom onto A and B. I.e. if the state is (A a), then I'd like to call "f :: StateMonad A m => m ()" and otherwise "g :: StateMonad B m => m()". I think I need prisms for that. Am I on the right track?
09:15 takle joined
09:15 <ertes> roundhouse: no, just lenses
09:16 <ertes> roundhouse: in fact no, just traversals
09:16 <roundhouse> ertes: how do I deal with the sum type?
09:16 <mutablemonkey> ertes: A combination of both. I personally think there is a fine line between doing it right and doing it at all.
09:16 <ertes> roundhouse: traversals can deal with sums… if it's a B and you zoom into A, nothing happens
09:16 <roundhouse> Ah cool. Can you point me to some example code?
09:16 ktonga joined
09:17 <ertes> > flip execState (Left 5) (zoom _Right (id += 7))
09:17 <lambdabot> Left 5
09:17 <ertes> > flip execState (Left 5) (zoom _Left (id += 7))
09:17 <lambdabot> Left 12
09:17 <ertes> roundhouse: all prisms are traversals as well
09:17 <ertes> > flip execState (Right 5) (zoom traverse (id += 7))
09:18 <lambdabot> Right 12
09:18 <lep-delete> :t (+=)
09:18 <lambdabot> (Num a, MonadState s m) => ASetter' s a -> a -> m ()
09:18 jgertm joined
09:18 <roundhouse> I see, thanks alot.
09:19 <roundhouse> I'll have to think about this and play around with it somewhat.
09:20 ozgura joined
09:22 sphinxo joined
09:23 <ertes> roundhouse: if you zoom into multiple components at once, all of them will change with the same formula
09:23 <ertes> > execState (zoom traverse (do _1 += 5; _2 <>= "!")) [(1,"abc"), (2,"def"), (3,"ghi")]
09:24 <lambdabot> [(6,"abc!"),(7,"def!"),(8,"ghi!")]
09:24 takle joined
09:24 locallycompact joined
09:24 <roundhouse> ah cool
09:25 <ertes> bonus: it only needs a single list traversal at run-time, so zooming into a traversal can have performance benefits, too
09:25 <roundhouse> I need to seriously read up on the lens package
09:25 andyhuzhill joined
09:25 <roundhouse> nice, but first I need to get it to compile ;)
09:25 zero_byte joined
09:25 <ertes> a traversal is something that points to arbitrarily many components, and a lens is a traversal that points to exactly one component =)
09:26 <ertes> a prism is something that points to 0 or 1 components, but also has enough information to *construct* it
09:26 <ertes> s/something/a traversal/
09:26 <roundhouse> ah I see
09:26 <roundhouse> do you have any recommended reading on this stuff?
09:27 <jle`> > review _Just 'a'
09:27 <lambdabot> Just 'a'
09:27 <ertes> no, i usually teach lens by using a providing exercises
09:27 <ertes> s/using a//
09:27 <jle`> i liked that lens over tea series
09:28 <roundhouse> I'll check that out, thanks
09:28 <jle`> but for practical usage, the lens library itself comes with good documentation and examples
09:28 grayjoc joined
09:29 <jle`> and that big scary diagram on the main page of the docs is actually a very readable diagram showing the subtyping hierarchy and what functions are usable with what types
09:29 <roundhouse> yes, it is just so huge, so sometimes it is hard to know where to look
09:29 <roundhouse> also I get scared by the types sometimes
09:30 dawehner joined
09:30 peterbec` joined
09:30 <jle`> for the most part you just need to understand the subtyping hierarchy and the types of the major optics
09:30 <ertes> roundhouse: i can give you three exercises that should give you a complete understanding of Lens… one more exercise to understand Traversal
09:30 <jle`> lenses, prisms, traversals, etc.
09:30 <Phyx-> 23:46:14 < geekosaur> (and I have no idea how Windows' TerminateProcess shows up in Haskell) <-- the answer is it depends on how you were waiting, but in almost all cases it won't translate into an exception
09:31 <roundhouse> ertes: sounds awesome, where can I find those?
09:31 <jle`> some of the more scary types in the library is just implementation detail
09:31 <ph88> hey guys, i want to use apache tika to process some pdf documents, then i want the results imported into haskell. Would it be better to use the tika CLI or the tika RESTfull service ?
09:31 <ertes> roundhouse: here: 1. write a function to map over the left component of a tuple: mapFst :: (a -> b) -> (a, c) -> (b, c)
09:31 silver joined
09:32 freusque joined
09:32 <roundhouse> ok, I can do that =)
09:32 sigmundv_ joined
09:32 <roundhouse> mapFst f (x,y) = (f x, y)
09:33 <ertes> roundhouse: 2. generalise this function to allow an effectful map: traverseFst :: (Functor f) => (a -> f b) -> (a, c) -> f (b, c)
09:34 <ph88> roundhouse, only chuck norris is allowed to carry that name
09:34 <roundhouse> ph88: how do you know I'm not him?
09:35 <roundhouse> I guess chuck norris would have no trouble with haskell
09:35 <ertes> roundhouse: chuck norris understands lenses better than edwardk
09:35 <ertes> so you can't be chuck norris
09:35 <roundhouse> damn
09:35 Ferdirand joined
09:35 takle joined
09:35 uglyfigurine joined
09:37 MindlessDrone joined
09:37 <roundhouse> traverseFst f (x,y) = fmap (\z -> (z, y)) (f x)
09:37 <roundhouse> might not be the most elegant way
09:37 <ertes> roundhouse: correct… and it's the only way =)
09:37 splanch joined
09:37 <ertes> now traverseFst happens to be a lens, but i'll explain why
09:38 <ertes> @let traverseFst f (x,y) = fmap (\z -> (z, y)) (f x)
09:38 <lambdabot> Defined.
09:38 <ertes> > (traverseFst +~ 5) (3, 7)
09:38 <lambdabot> (8,7)
09:38 <roundhouse> > :t +~
09:38 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
09:38 <roundhouse> > :t (+~)
09:38 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
09:38 xtreak joined
09:38 <kadoban> :t (+~)
09:39 <lambdabot> Num a => ASetter s t a a -> a -> s -> t
09:39 <roundhouse> thanks
09:39 Cassiopaya joined
09:39 <ertes> roundhouse: if you instantiate traverseFst at f = Identity, you get mapFst behaviour… in fact you can write mapFst in terms of traverseFst now
09:39 <jle`> (+~) :: Num a => Lens' s a -> a -> s -> s
09:39 NeverDie_ joined
09:39 <ertes> roundhouse: exercise 3: can you think of an 'f' that allows you to *extract* the value of the first component rather than changing it?
09:41 <kadoban> :t traverseFst
09:41 <lambdabot> Functor f => (t2 -> f t1) -> (t2, t) -> f (t1, t)
09:41 NeverDie joined
09:42 <jle`> > traverseFst (\_ -> Proxy) (1, 2)
09:42 <lambdabot> Proxy
09:42 <jle`> aw shucks
09:42 merijn joined
09:43 phaji joined
09:44 augur joined
09:45 kosorith joined
09:46 <ertes> jle`: no, you forgot: what's the answer to all questions?
09:46 cur8or joined
09:47 <jle`> ?? :o
09:47 <lambdabot> :o
09:47 <ertes> it's ContT!
09:47 twanvl joined
09:48 certainty joined
09:48 <ertes> > runCont (traverseFst (cont . const) (3, 5)) undefined
09:48 <lambdabot> 3
09:48 <jle`> lol
09:48 <ertes> roundhouse: (ignore that… Cont is not the correct answer) =)
09:48 <jle`> if i were to do this without knowing the answer i would have used [[spoilers]]
09:48 <jle`> click to reveal
09:50 <phadej> merijn: I'd like to release bound, but it's up to edward
09:51 <merijn> phadej: I already bugged him too :p
09:51 <phadej> and IIRC it's still blocked on `free` release too
09:53 KarboniteKream joined
09:53 <phadej> I.e. you cannot use Free XXX as `bound` monad
09:53 locallycompact joined
09:53 <phadej> iirc
09:53 lukaramu joined
09:54 takle joined
09:55 <phadej> anyhow, I'll do some maintaining tasks
09:55 gregman_ joined
09:55 selthas joined
09:56 selthas joined
09:58 selthas1 joined
09:59 selthas1 joined
09:59 Booba joined
10:01 <ph88> would you guys prefer a CLI or REST interface to external utility ?
10:02 <roundhouse> ertes: I'm confused, does the f in exercise 3 refer to the functor or the a -> f b?
10:02 uglyfigurine joined
10:02 <ertes> roundhouse: the functor
10:02 tomboy64 joined
10:03 tdf joined
10:03 <ertes> traverseFst :: (Functor f) => (a -> f b) -> (a, c) -> f (b, c)
10:03 <ertes> roundhouse: the goal is to return the 'a' from this function
10:03 <ertes> so you need to pick an f such that: f (b, c) ≃ a
10:03 anton___ joined
10:04 <mfukar> ph88 , if it can't be a package, conventional IPC is my next thing to look for
10:04 <roundhouse> ok, thanks. I'm a slow thinker ^^
10:04 <ertes> roundhouse: take your time
10:04 <mfukar> ph88, CLI and REST are near the last things I would try
10:05 <ertes> ph88: depends… why do you need an external interface?
10:05 <ph88> i want to use apache tika
10:05 <ph88> mfukar, i never used conventional IPC and i'm not sure tika supports it
10:06 <ertes> ph88: how is that related?
10:06 <ph88> ertes, apache tika offers CLI or REST i want to use it with my haskell app
10:07 <ertes> ph88: so your application needs communicate with tika using CLI tools or a REST API?
10:07 Yuras joined
10:07 <ph88> yes i think so
10:07 <ertes> ph88: that doesn't mean your application needs to have one itself
10:07 <ph88> it will be a command line app where you specify a file or directory then haskell goes to search the files and send them to tika, then the tika result goes back to the app and it puts it in elasticsearch
10:08 <ph88> ertes, how so ?
10:08 <ertes> ah
10:08 <ertes> ph88: is this supposed to be used locally only?
10:08 selthas1 joined
10:08 <ph88> yes
10:09 <ph88> after the command line tool done it's job and all the documents are in elasticsearch i start the spock web app that presents the documents on a webpage
10:09 <ertes> ph88: there are a number of options… the easiest might be to use something like fsnotify on a directory from your app… whenever a file pops up there, your app feeds it to tika and deletes it afterward
10:10 <ertes> the other option, probably the safer one: use a unix socket
10:10 ericsagnes joined
10:10 norotartagen joined
10:11 <ph88> i don't need notification for now .. i have hundreds of documents that need to be imported once
10:11 <ph88> very seldomly a new document appears
10:11 <ph88> i can worry about that later, but i think in that case someone will upload it through the web app
10:12 <ertes> well, one question i'd ask is: does the web app even have to be aware of that? a separate program could feed documents into tika and elasticsearch
10:12 <ph88> yes i'm talking about the separate program
10:13 <ph88> import: pdf -> separate program (CLI) -> tika -> separata program -> elasticsearch
10:13 <ph88> reading: spock -> elasticsearch
10:13 KarboniteKream joined
10:13 <ertes> that sounds reasonable
10:14 <merijn> ok, so I have a transformer stack with Except (i.e. Either) as base monad, but I want some operation to use the Validation applicative. Is there an easy way to mix things?
10:14 <ph88> ya but for tika i can choose to launch it as command (tika can be CLI) or i can do REST client in my separate (cli) program
10:15 knupfer joined
10:15 <merijn> I guess I could use mmorph to selectively generalise/degeneralise them?
10:15 etehtsea joined
10:15 Jacoby6000 joined
10:16 <knupfer> Should I choose tasty or hspec? What are the disadvantages?
10:16 mmn80 joined
10:16 <knupfer> tasty doesn't use a monad, so it seems less convenient but more sound?
10:17 NeverDie joined
10:18 <ph88> ertes, just like to know an opinion if it's easier to interface CLI or REST with haskell
10:19 <Booba> ertes: Hello! Wanted to kindly ask if there's a chance you might elaborate on your most awesome hangman-game example any time soon?
10:19 selthas1 joined
10:25 Rainb joined
10:30 Glooomy joined
10:31 FreeBirdLjj joined
10:31 peterbec` joined
10:31 benjamin2 joined
10:32 carlosda1 joined
10:32 <ph88> is there a way that i can use "reply" inside the main do-block? when i use "when" i had to make a sub do-block for things to compile https://bpaste.net/show/742c535f4546
10:33 ramzifu joined
10:33 ebzzry joined
10:33 <geekosaur> you cannot if you are using when, exactly for that reason
10:34 <geekosaur> also you need to decide what value reply will have if exists is true
10:35 <ph88> you mean theoretically speaking ? when i was using if/then/else instead of when or something ?
10:35 netheranthem joined
10:36 <geekosaur> if you want reply to be available, it has to have a value
10:36 rcat joined
10:38 <geekosaur> ...I guess that made no sense to you?
10:38 <geekosaur> I am trying to figure out what you think is going on
10:39 <geekosaur> you want `reply` to exist outside the constraint of `when (not exists)`. this can only happen if it can be given a value also `when exists`
10:41 BadenKys joined
10:43 <ertes> Booba: did you see my summary yesterday?
10:43 <ertes> ("yesterday" from my perspective at least)
10:43 <geekosaur> @undo do { reply <- something; somethingElse }
10:43 <lambdabot> something >>= \ reply -> somethingElse
10:43 <Booba> ertes: yes, that gave me some insights, thanks
10:43 nwf joined
10:44 <ertes> Booba: if you have specific question, i'm happy to answer them
10:44 <ertes> *questions
10:44 <Booba> ertes: I wanted to ask about the Hangman datatype. I see you defined IsString and Monoid instances. But I cant put my finger on what the two constructor parameters stand for
10:45 <Booba> ertes: * of Guess contructor
10:45 <erisco> where do I get my hands on this hangman program?
10:45 <roundhouse> ertes: I think the `Const a` functor should work. Then traverseFst :: (a -> Const a b) -> (a, c) -> Const a (b, c), and the only sensible implementation of ( a -> Const a b) seems to be `Const` (the constructor), so that in the definition the fmap is ignored.
10:46 <ertes> Booba: if a game is (Guess xs f), then it represents a running game with a challenge xs and a continuation function f… given a guess x, (f x) will be the game updated with that guess
10:46 coot joined
10:46 <ertes> Booba: it may be useful to know that 'xs' is purely for presentation purposes, it has no meaning in terms of game logic
10:47 <ertes> in this case it's used to communicate the current challenge to the player
10:47 <ertes> roundhouse: correct
10:47 <ertes> roundhouse: now you can actually write functions like these:
10:47 <Booba> ertes: ok, so the challenge is [Maybe a] to represent the correct guesses with Just a, correct?
10:47 <ertes> view :: ((a -> Const a b) -> s -> Const a t) -> s -> a
10:48 Rainb joined
10:48 <ertes> over :: ((a -> Identity b) -> s -> Identity t) -> (a -> b) -> s -> t
10:48 m1dnight_ joined
10:48 <erisco> http://community.haskell.org/~ertes/hangman/
10:48 <ertes> Booba: correct
10:49 <ertes> oh, shit, i forgot about that one =)
10:49 ebzzry joined
10:49 <ertes> it's not complete though
10:50 <erisco> that's the first Google result
10:51 <ph88> this is how i thought would be a good idea to structure this code https://bpaste.net/show/d1b2dd0f4eba however i get an error (which i can solve with hasFiles <- any doesFileExist paths ) but now i wonder if this is the right way to structure my code with all these if/then/else ?
10:51 _sras_ joined
10:52 <Booba> ertes: that helps a lot. And what about Hangman type itself. Is there any relation between its type parameters a and b?
10:52 Kundry_Wag joined
10:52 <ertes> Booba: apparently i've already written an incomplete tutorial for that in 2015; see erisco's link =)
10:52 <roundhouse> ertes: Thanks very much for taking the time to explain me all this.
10:52 <_sras_> Is there any way to auto derive FromJSON instances and provide rules on how to transform field names to json keys?
10:52 <ertes> Booba: no, i tend to generalise like that to get additional type safety, and it helps me keep things apart
10:53 <ph88> eh that fix didn't even work but that's beside the point :/
10:53 <phadej> _sras_: there aren't :/
10:53 <Booba> ertes: ok, I'll take a look, thanks! Still I can't imagine myself doing problem solving in such way, yet =)
10:53 <erisco> ertes, what is the other link?
10:53 m1dnight1 joined
10:53 <ertes> erisco: hmm?
10:53 <erisco> and though I am still reading (and it looks interesting), a real-time game can be modeled as a turn-based game
10:54 <erisco> well there is some other link Booba is reading
10:54 <ertes> so far i've only showed them code
10:54 <Booba> erisco: https://raw.githubusercontent.com/esoeylemez/snippets/master/Hangman.hs this one
10:54 <ertes> yeah, that
10:54 <erisco> the difference between real-time and turn-based is in presentation
10:55 <ertes> ("showed"? "shown"?)
10:55 <ertes> "shown" i think
10:55 <geekosaur> yes
10:55 <erisco> I suppose you could describe some difference in the game rules
10:55 <erisco> such as a turn-based game offers unlimited time to make an action whereas a real-time game offers limited time to make an action (else defaults to no action)
10:56 <erisco> but then if you have a turn-based game with a turn timer that falls apart
10:56 <ertes> erisco: well, with real-time games you can embrace the continuum and represent things as FRP behaviours
10:56 <ertes> although that also works for turn-based games, i guess
10:56 <ph88> is that even possible to use these two functions together? any :: (a -> Bool) -> [a] -> Bool doesFileExist :: FilePath -> IO Bool
10:56 <erisco> right
10:56 tromp joined
10:57 <ph88> @src any
10:57 <lambdabot> any p = or . map p
10:57 <ertes> the current challenge might be a behaviour, and it might change in reponse to a guess event
10:57 <erisco> maybe you could make the distinction around human reaction time
10:57 <geekosaur> ph88, your first thought was correct but I'm guessing you did it wrong
10:58 <ph88> geekosaur, which first though? i think i can not use any but i have to use or . mapM_ or something like that
10:58 <erisco> in any case, I only meant to point out that in a technical sense they're not all that different, even though presentationally we accept then differently
10:58 <geekosaur> not mapM_, that discards results but you need the result
10:59 <ph88> mapM
10:59 Kundry_Wag joined
10:59 <_sras_> phadej: Won't this work? https://hackage.haskell.org/package/aeson-1.1.1.0/docs/Data-Aeson.html#v:genericParseJSON
10:59 <ph88> but i'm right i can't use any for IO values ?
10:59 <geekosaur> not directly like that
11:00 <erisco> another example is tool-assisted speed runs... normally a real-time game yet it is being presented as turn-based
11:00 <ertes> erisco: well, this is really just a special case of a pretty generic state machine
11:00 <geekosaur> checks <- mapM doesFileExist paths; if not (any checks) then ...
11:01 <geekosaur> also why are you using printf wiith a literal string and a dummy parameter instead of putStrLn
11:01 <ertes> erisco: data Auto r a b = Done r | Auto (a -> (b, Auto a b))
11:01 <merijn> Insert usual complaint against using doesFileExist
11:01 <erisco> I have to get through your article still
11:01 <erisco> I probably would have made what you're calling a mistake, so I am learning :)
11:02 <ph88> geekosaur, sometimes i want to put 2 newlines in the printf ... put i'm still protoyping .. maybe later i will add parameters or if not i can replace it with putStrLn .. is there any downside to printf except for having to put () ?
11:02 <geekosaur> weird errors if you get it wrong, because printf in Haskell is a horrid hack?
11:03 <geekosaur> (nasty typeclass hackery that produces confusing errors)
11:03 danthemyth joined
11:03 <phadej> _sras_: it will, but you have to write instances still, you cannot say "deriving instance FromJSON MyType using myOpts" or something like tht
11:03 <geekosaur> also I don't see why printf "... \n\n" () is preferable to putStrLn "...\n"
11:04 <roundhouse> :t _Left
11:04 <lambdabot> (Applicative f, Choice p) => p a (f b) -> p (Either a c) (f (Either b c))
11:05 <ph88> geekosaur, i replaced the printf but something is not quite right with what you suggested https://bpaste.net/show/e6c73c5a1bc6 i'm still looking into it
11:06 <geekosaur> mm, any is the wrong thing there
11:06 <geekosaur> :t or
11:06 <lambdabot> Foldable t => t Bool -> Bool
11:07 <ph88> too bad this syntax is not allowed isFiles :: [Bool] <- mapM doesFileExist paths
11:07 <geekosaur> it is allowed with ScopedTypeVariables, but it will not help
11:08 <geekosaur> that's not the problem
11:08 jluttine joined
11:09 <geekosaur> if not (or isFiles) then ...
11:09 xall_ joined
11:09 <erisco> ertes, heh, you could say it is actually an article about monoids and abstract algebra :P
11:13 Ferdirand joined
11:13 <ertes> erisco: yeah, my articles tend to be like that =)
11:13 splanch joined
11:13 <ertes> erisco: if you love monoids as much as i do, here is more brain fodder: http://ertes.eu/tutorial/config-monoids.html =)
11:13 nutzz joined
11:15 ayujup joined
11:15 <cocreature> there is also a functional pearl paper on monoids which is great
11:15 <ph88> i have this little snippet of code mapM_ (\x -> makeAbsolute x >>= putStrLn ) paths but this still prints directories with .. in them, should i use canonicalizePath or am i doing something wrong here ?
11:15 systadmin joined
11:16 Juste1 joined
11:16 <ph88> canonicalizePath works as expected, i'm just surprised that makeAbsolute doesn't seem to do anything
11:16 <ayujup> I'm on Debian Strech, trying to `stack upgrade`. I get tons of 'can not be used when making a shared object; recompile with -fPIC' errors. This is even mentioned in https://github.com/commercialhaskell/stack/blob/master/doc/faq.md. Tried to change to current stackage with ghc 8.0.2, but this doesn't seem to help. Anybody solved this issue?
11:16 fakenerd joined
11:17 <ph88> i don't want to follow symbolic links that canonicalizePath does, but i still want the absolute path without ..
11:17 <ayujup> https://github.com/commercialhaskell/stack/blob/master/doc/faq.md#i-get-strange-ld-errors-about-recompiling-with--fpic to be precise
11:17 <erisco> ertes, you need a more sophisticated game than Tenderman to really show off what you're getting at
11:18 <geekosaur> ph88, makeAbsolute only forces the path to start with /, it does not resolve . or .. within the path. canonicalizePath does that, and it *must* resolve symlinks if you do that
11:18 _sg joined
11:18 <geekosaur> because you can have a symlink to a directory, and if you follow .. up from it then you are in the parent to the actual directory, not the directory the symlink is in
11:18 <erisco> one way to branch is to test if UglyTenderman is won, a Bool predicate, and you've instead changed how Tenderman is defined
11:19 <ph88> geekosaur, why must it resolve symbolic links to resolve .. ?
11:19 <ph88> oh ok
11:19 <erisco> now we have a constructor for each scene in the game ("scene" is a term I have seen used in game frameworks)
11:19 <erisco> so we might have a menu scene, a play scene, a game over scene, etc
11:19 <geekosaur> (note that bash will confuse you if you test this there instead of in a program, it's a known wart in bash)
11:20 <ph88> geekosaur, is there a function that tries to resolve .. but when it hits a symlink it fails? so a makeAbsoluteMaybe ?
11:20 <erisco> the addition of the continuation is interesting, but I am not completely sure of it
11:20 Yuras joined
11:20 <geekosaur> ph88, no
11:20 <ph88> :(
11:20 <ph88> i will keep with canonicalizePath then
11:20 <erisco> in one sense it is just another way to store the state
11:20 <geekosaur> and if there were, it'd just be multiplying edge cases
11:21 <erisco> in the continuation is the complete word, for example
11:21 <geekosaur> it is generally best not to try to be clever about paths, they will bite you
11:21 <erisco> we could do this differently with, say, Reader or State
11:22 <ertes> erisco: no, the idea is that Hangman is an *extension* of Tenderman, and it can be defined without changing Tenderman at all by writing a monoid morphism
11:22 <geekosaur> someone will run your program in a mounted smbfs with a reparse point, or in AFS or GFS or ..., and your clever code will do unexpected things
11:22 <ertes> erisco: but i never completed that tutorial
11:22 <ph88> geekosaur, maybe there is a function that says the path contains a symlink ?
11:22 <geekosaur> ...
11:23 <ph88> geekosaur, ok but it's confusing for the user
11:23 <geekosaur> I guess being as clever as possible is critical?
11:23 Rainb joined
11:23 <ph88> if there are a lot of .. in the path then the user will get confused
11:23 <geekosaur> what;s more confusing to the user, .. or weird errors for paths that are valid?
11:23 <ph88> when the symlinks are resolved the user will also get confused
11:23 bjz_ joined
11:23 <ertes> erisco: the next advantage is that you can generalise Tenderman first to cover all kinds of guessing games, then to cover all turn-based games and finally to cover all state machines
11:23 <ertes> erisco: and in practice i would generalise *first*
11:24 <ph88> geekosaur, i was thinking that in case the path contains no symbolic links or other things that can trip up i will show the canonicalizePath otherwise i will show the absolutePath
11:24 <ph88> this will be the most user friendly
11:24 <erisco> ertes, well I am not sure what you're committed to then
11:24 <geekosaur> you can;t test for an smbfs reparse point
11:24 <erisco> ertes, is it how you defined Tenderman or is it the monoid or is it both?
11:25 <geekosaur> you can test for ?FS volume mountpoints but you'd have to deal with the filesystem tools not being present on most systems
11:25 <ertes> erisco: what do you mean? and are you asking in the context of the article?
11:25 <erisco> what is your opinion at this moment?
11:25 lok joined
11:25 <ph88> geekosaur, maybe it would be enough to see what the effect was on the path after it's been processed by the machinery in canonicalizePath ?
11:25 <geekosaur> you are trying to be "nice" to your users, but you cannot handle all cases, you can't even detect some of those cases
11:26 <ertes> erisco: about what?
11:26 splanch joined
11:26 <ph88> ok i guess i will just show both then :/
11:26 koserge joined
11:26 koserge left
11:27 <geekosaur> if it's that overridingly important to be clever, just be clever and deal with the fallout when the filesystem is cleverer than you are
11:27 deepfire joined
11:27 <ph88> i mean if the canonicalizePath is /my/path and the absolutePath is /my/../my/path then it' s pointless to show the absolutePath
11:27 ramzifu joined
11:27 grayjoc joined
11:27 <geekosaur> it's the wrong thing to do for robustness bt you apparently consider it that important
11:28 <ph88> :(
11:28 <ph88> i prefer robustness, but this is just very unfriendly
11:28 <ph88> for the user
11:29 <ph88> i will put it in the manual that it will resolve symlinks and mount points
11:30 <ph88> eh reparse point
11:30 splanch joined
11:30 oisdk joined
11:31 danza joined
11:32 peterbec` joined
11:32 Rainb joined
11:32 xtreak joined
11:34 <ph88> what's a good library to be a REST client ?
11:34 Cassiopaya joined
11:35 Yuras joined
11:36 <brynedwards> http-conduit
11:36 <cocreature> the author of megaparsec also released one relatively recently which looked interesting but I haven’t played around with it
11:36 <brynedwards> req ?
11:37 <cocreature> https://github.com/mrkkrp/req
11:37 <ertes> ph88: if you don't mind first specifying the API on the type level, you can derive a client using servant
11:37 <cocreature> yep
11:37 <erisco> ertes, on all the stuff before monoids I am saying I am not sure about using this approach over the Ugly one
11:37 <ertes> erisco: i would take the algebraic approach most of the time
11:37 <erisco> ertes, with the monoids I'd have to think about what the monoid on Ugly is
11:38 <erisco> not just what it is, because that is obvious, but what it gives you
11:38 <ertes> erisco: no, you first define the game type and the realise that it's a monoid… you don't start with the intention of creating a monoid
11:38 <ertes> it just happens to be one, and you exploit that
11:38 <erisco> that isn't what I am saying
11:39 <erisco> you began with the premise that "X is the wrong way to do it, do it Y way instead"
11:39 doomlord joined
11:39 <ertes> erisco: well, monoids (and most other structures) give you compositionality and composability
11:39 <erisco> only considering the article up to but not including the monoids I am not sure the case is made
11:40 <erisco> so if monoids make the case then it has to be that the monoid on Y is better than the monoid on X
11:40 <ertes> once you have a monoid you have a compositional API (<>), you get access to a lot of utility functions (foldMap) and composability (product monoids)
11:40 <erisco> and by "better" I mean lends better facility to implementing our game
11:40 JeanCarloMachado joined
11:40 <erisco> you can define a monoid for Ugly
11:40 feynhat joined
11:40 <ertes> later down the line you get extensibility (monoid morphisms) or in other words: you get principled ways to translate from a DSL to another one
11:40 <erisco> so you get all those things you are talking about for Ugly
11:40 <ertes> ah, now i understand what you mean
11:41 yellowj joined
11:41 asthasr joined
11:41 <erisco> I am talking about the simple logic of the argument, yes
11:41 <ertes> one thing you don't get with Ugly is composition of game logic… you still need to write a function with full knowledge management
11:42 <erisco> and I think the key difference is the inclusion of the continuation
11:42 <erisco> because Ugly has nothing about the transitions of state, it is only state
11:42 <ertes> yeah, the continuation integrates the game logic into the game state (and in fact makes the actual game state invisible, because it's not relevant to the user)
11:42 <erisco> so a monoid on Ugly only composes state, whereas a monoid on non-Ugly also composes transitions
11:42 spatial joined
11:42 <ertes> also Tenderman provides a safe API by construction… Ugly is unsafe
11:43 <ertes> a user could cheat
11:43 <erisco> this is interesting because I ran into something similar when working on UIs
11:43 tlaxkit joined
11:43 <erisco> I wanted a more robust way to implement the flow of our user interfaces and so I turned to state machines
11:43 <spatial> I still have some problem withs recursive functions. Nested
11:43 <ertes> oh, speaking of UIs: you can't separate the game logic from the UI without essentially reinventing Tenderman
11:43 <erisco> and I realised something similar to what you are talking about
11:43 <erisco> wrt state machines
11:44 <ph88> Req is an easy-to-use, type-safe, expandable, high-level HTTP library that just works without any fooling around. -- sounds good :P
11:44 Yuras joined
11:44 <erisco> but I never had it completely ironed out so maybe you have a better solution
11:44 <ph88> especially the "just works" part
11:44 skeuomorf joined
11:44 <ertes> erisco: FRP =)
11:45 splanch joined
11:45 <erisco> eh, I am not sure that resolves all the questions about state machines one would have
11:45 <ertes> no, but it's a good way to manage the state of a UI
11:46 <ertes> without actually thinking in terms of state
11:46 <erisco> sure, you've got switch and friends, but that is really the only way FRP touches state machines that I can discern
11:46 <spatial> I think I need 'let'.
11:46 <erisco> well the whole point is to think in terms of state
11:46 henriksod joined
11:46 <erisco> that is the desired model
11:46 eklavya joined
11:46 <cocreature> spatial: I think you need to provide more information if you want us to help you :)
11:46 splanch_ joined
11:46 <erisco> the user clicks the button, now it is processing, now it is finished and results are displayed
11:47 merijn joined
11:47 Faucelme joined
11:47 <ertes> erisco: no, switching only involves a rather trivial form of state… the way you introduce state is by using what i call event scans: stepper in reactive-banana, foldDyn* in reflex 0.4, accum* in reflex 0.5, scan* in wires
11:47 <spatial> cocreature:Your suggestion. Thanks. It is being tested. http://lpaste.net/354055
11:47 <erisco> I said "and friends"
11:47 <cocreature> spatial: so what kind of problems are you running into?
11:48 <ertes> erisco: switching and event scans are pretty much unrelated concepts
11:48 <ertes> except that they are both FRP, i guess =)
11:48 <spatial> It does work. numbins is being decremented by both functions. I need to copy using let ?
11:48 <erisco> no, they're more related in that, but not in the technical sense of FRP
11:48 <erisco> they're more related in application
11:49 <erisco> you want a thing that changes when a thing happens
11:49 <ertes> erisco: if processing takes real time, the button to start processing is an event that is bound to the real world, and a separate event delivers the result
11:49 <erisco> well, switching and scans then fit that vague idea
11:49 carlosda1 joined
11:50 <cocreature> spatial: I don’t understand that statement. which two functions are you referring to? only loop1 decrements numbins
11:50 <ertes> erisco: if the processing happens within the reactive system, then processing is just an event scan
11:50 RGamma joined
11:50 <cocreature> spatial: I guess "loop" decrements nb but then I don’t understand what you expect
11:50 <erisco> well, I don't know what to say, other than state machines were relevant for me even with FRP involved
11:51 <cocreature> spatial: ah maybe you intend to call "loop1 nb …" instead of "loop1 numbins" in line 6
11:51 <ertes> erisco: yes, scans *are* state machines
11:51 <erisco> well, it was knock-off FRP
11:51 JuanDaugherty joined
11:51 <erisco> and I implemented with a scan, yes! but that is as far as FRP is involved
11:51 <spatial> I think they are different. nb and numbins
11:52 <ertes> erisco: yes, FRP is more about connecting many such components… the individual components are fairly boring from FRP's viewpoint
11:52 <erisco> the whole thing looks the same except you decorate with Event and Behaviour as appropriate
11:52 <ertes> erisco: for example implementing Tenderman with FRP would be pretty pointless
11:52 <spatial> Are they both copies of the parameter ?
11:52 <cocreature> spatial: by calling "loop1 numbins" you are referring to the initial value of numbins that is passed to playrepeatedly. "nb" is initially set to "numbins" in line 3 but you update it at each iteration of "loop"
11:52 <cocreature> spatial: maybe try renaming the parameters so you don’t have name collisions
11:53 <cocreature> and then once you’ve figured out how to make that work go back and figure out shadowing
11:53 <erisco> my stumbling block wrt state machines was embedding one within another
11:53 <ertes> erisco: but then you find yourself implementing a menu to start new games, have multiple games running simultaneously, having a clock ticking with a time limit for the next move, etc.
11:53 <ertes> erisco: that's the point when FRP becomes useful
11:53 <ertes> in other words: FRP makes this scalable
11:53 <erisco> well I don't think FRP had anything to do with it
11:54 <merijn> Retry: Anyone here have experience mixing Validation and Either? I have an Either based monad stack that I (in certain places) want to use Validation instead (I'm doing typechecking for some issues I want to collect *all* errors)
11:54 <erisco> I was trying to make particular transforms work and I am not sure I ever quite got it right
11:54 <erisco> unfortunately the project ended before I was able to get too far on that work
11:54 <ertes> erisco: well, most state machine types form some structure: Applicative, Arrow, etc.
11:54 <spatial> cocreature:Think it is alright. Let me test somemore.
11:54 <cocreature> merijn: I’ve used Validation at some point. not sure if that counts as experience :)
11:54 <merijn> However, there's no really convenient way to do this, apparently? I'm wondering whether anyone has done something like that before
11:54 <ertes> erisco: even pipes' Proxy type is in essence a state machine type
11:54 <ertes> then "embedding" is really just composition
11:55 <ph88> did something change in stack that i now get these messages during install? Package entropy uses a custom Cabal build, but does not use a custom-setup stanza Not using the explicit setup deps approach based on configuration Strongly recommend fixing the package's cabal file
11:55 <merijn> cocreature: I've used Validation before, my specific issue is how to go about mixing Validation and Either/Except, with a lot of boiler plate conversions
11:55 <erisco> ertes, I would have to drag out all my notes and code to recall what exactly the issues were
11:55 <merijn> cocreature: Since some of my checking is monadic, but others are the same monadic check a bunch of time in parallel
11:55 <ertes> erisco: i think i had an automaton tutorial somewhere, which covers this: the concept of local state
11:55 <cocreature> merijn: it provides an _Either Iso, does that help avoiding some of the boilerplate conversions?
11:55 <dcoutts> ph88: Cabal now supports explicitly declaring Setup.hs script deps in a custom-setup stanza. This is now recommended practice.
11:56 jdnavarro joined
11:56 <merijn> cocreature: I figure I can use "mmorph" to change the underlying thing, but I'm not sure how costly that
11:56 featherlessbiped joined
11:56 jdnavarro joined
11:56 <erisco> ertes, I had a particular definition of state machine and that could have doomed me, I am not sure
11:56 <merijn> cocreature: I have "ReaderT Env (Except Error)", basically, so I have to change the validation/either "under" Readert
11:56 <geekosaur> ph88: stack also does that, because setup deps are hard to get right otherwise (stack couldn't build recent gtk2hs because of its setup deps, for example)
11:57 <ertes> erisco: possibly yeah, but it's really easy to make an automaton type that is composable
11:57 <merijn> cocreature: Just seems odd I'm the first one running into this? :)
11:57 <erisco> ertes, I will eventually be dragging it out again next time I try to make a UI because all roads were leading in that direction
11:57 <ertes> erisco: the 'machines' library has a bunch of those, look in particular at Mealy
11:57 <cocreature> merijn: hm I guess I’ve never had a need for it :)
11:57 <erisco> I was suddenly able to easily make much more sophisticated UIs once I had this in place
11:57 <ertes> erisco: you may have been reinventing AFRP =)
11:57 <merijn> Anyway, meeting now, I'll figure something out later :)
11:58 <erisco> never heard of it, but I was already using knock-off FRP
11:58 bryanlemon joined
11:58 <erisco> again, it isn't that relevant to the state machine
11:58 <ertes> erisco: wires, yampa, …
11:58 <erisco> if you looked at the equivalent state machine without FRP you'd see it is the same thing but with Event and Behaviour decorating a few things
11:58 <ertes> erisco: in AFRP the A secretly stands for "automaton" =)
11:59 <dcoutts> geekosaur, ph88: sorry, to be clear I meant that Cabal (lib/build system) has this feature, and indeed stack and cabal-install now make use of it and recommend it as good practice so we can track deps properly.
11:59 <ertes> erisco: it's literally an automaton framework
11:59 <Jinxit> anyone around that has used Earley? got some issues with recursive grammars
12:00 <erisco> ertes, so my request is that you finish your article so I can learn of the Hangman morphism
12:00 <erisco> ertes, else I'll have to rethink it myself :P
12:00 <erisco> plus your generalisations to all state machines, which is what I'm actually interested in
12:00 Eduard_Munteanu joined
12:01 HoierM joined
12:01 <erisco> ertes, wrt the button and loading example, that was a simple description of a state machine behind many dialogs on our app
12:01 Kundry_Wag joined
12:02 <erisco> ertes, many of our dialogs prompted the user for some input, then passed this to some side effectful function, then a result came in some unknown time
12:02 <erisco> ertes, so I designed a state machine to handle this general problem
12:02 <erisco> made everything much, much easier
12:02 <ertes> erisco: i would have solved this with regular FRP
12:03 <erisco> it doesn't work well with that alone
12:03 <erisco> it was what I already had
12:03 <erisco> the problem is that the interface goes through different states
12:03 Sh4rPEYE joined
12:03 <erisco> so there is the state where you enter input, then the state where it is processing (which should occlude the inputs and display a loader)
12:03 <erisco> then a state on completion
12:03 <erisco> and also states for errors
12:04 <erisco> by having the states it made programming the view trivial
12:04 <ertes> doesn't sound like a problem… it's fairly easy to model that
12:04 <erisco> I just branch on the state and show the corresponding view
12:04 <erisco> yeah, I made it easy, lol
12:05 <erisco> trying to tease these states out of "what does the view model look like it is doing right now" wasn't so easy
12:06 <ertes> with FRP i could easily model an application that supports multiple concurrent requests, displaying the current state of all pending requests as well as any results and errors that occurred
12:06 <erisco> it also made resuming more straight-forward which is an annoying problem on mobile
12:06 <erisco> well, go do it and in such a way that there is nothing resembling a state machine
12:07 <erisco> and if you find that too easy then try it in a crippled FRP implementation called Rx
12:08 <erisco> where anything involving side effects will make you lose hair
12:10 xanadu_ joined
12:11 <ertes> erisco: you could also just watch one of ryan trinkle's videos on reflex
12:12 <ertes> he does present UIs that do exactly that (posting to twitter, waiting for acknowledgement, etc.)
12:12 ziocroc joined
12:13 <ertes> erisco: in some cases you may also find this library useful: https://hackage.haskell.org/package/predictive
12:13 data_hope joined
12:14 <erisco> I spent many months working on this problem
12:15 <erisco> for you to not think the solution looks like a state machine then we have very different concepts of state machine
12:15 <ertes> erisco: if you look close enough, this code looks like a state machine, too:
12:15 <ertes> > [1..]
12:15 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
12:15 <ertes> "looking like a state machine" is not a useful way to categorise
12:15 nomicflux joined
12:16 <erisco> I disagree
12:16 <erisco> you're using it yourself
12:16 <ertes> in any case, look up his videos… it's a highly declarative and *easy* way to model what you said
12:17 <ertes> the reason is that all this complexity is built into and *hidden* in the reflex library
12:17 <erisco> Haskell wasn't an option when I was working
12:18 <erisco> hopefully I can use Haskell next time so I'll revisit it then
12:18 <ertes> well, that's unfortunate =)
12:18 xanadu_ joined
12:18 <erisco> but I don't need to be shown simple ways to model an asynchronous request with FRP
12:18 <erisco> I've seen that many times
12:19 wtetzner joined
12:19 <ertes> i wouldn't think of those examples as "simple", they involve some fairly heavy machinery under the hood
12:20 <ertes> but the whole point of it is that they become simple from a programmer viewpoint
12:20 <ertes> it's a simple application on the surface, and the code should reflect that
12:21 pavonia joined
12:21 <ertes> the other point is that it scales… you can add more complexity without going insane
12:22 alfredo_ joined
12:24 eacameron joined
12:25 <erisco> reflex-dom is probably neat
12:25 <erisco> that is the first thing I tried doing with FRP and ghcjs
12:25 <erisco> turns out it is a bit of a bother to manipulate DOM children in just the way you want
12:26 Kundry_Wag joined
12:26 deepfire joined
12:26 mda1 joined
12:28 <spatial> Do functions execute one after the other as declared ?
12:28 data_hope joined
12:28 <erisco> no, nor do they execute
12:29 <erisco> we define things, so we define foo = bar, and we write expressions, and expressions are evaluated
12:30 <erisco> there are functions like putStrLn which are special in that they do have an executional component to them
12:30 <ertes> erisco: i've never actually used reflex-dom myself, so i wouldn't know… i only use reflex
12:30 <erisco> when those evaluate they produce a side effect
12:30 <ertes> erisco: but judging by the things they do with reflex-dom, i'm pretty sure it supports that kind of thing
12:30 <spatial> func1 param1 followed by func2 param2. func1 takes some time.
12:30 <geekosaur> I am imagining spatial has never seen a compiled language
12:31 <geekosaur> only scripts
12:31 <geekosaur> meaning, procedural atuffat the top level executing in order
12:31 <geekosaur> *stuff at the
12:31 <erisco> spatial, what do you mean by "func1 takes some time" ?
12:32 <erisco> are we arguing the narrow point of taking time and producing waste heat as being side effects?
12:32 <erisco> well, based on your initial question, I don't think so
12:33 <spatial> erisco:func1 works on a data structure. func2 should be called after it finishes.
12:33 peterbec` joined
12:33 <erisco> that just isn't a thing in Haskell, there are no statements, and what you're describing sounds like statements
12:33 <geekosaur> relentlessly procedural
12:34 carlosda1 joined
12:34 <erisco> geekosaur, sounds like a great T-shirt slogan
12:34 Boomerang joined
12:35 <erisco> spatial, if you're new to Haskell we can point you at some learning resources, or if you have specific questions we can answer them here
12:35 <ertes> spatial: outside of your development cycle (i.e. in a compiled program) there is only one way to cause things to happen: 'main'
12:35 <erisco> but it is a bit lengthy to explain the entire concept of how Haskell programs work
12:35 <ertes> spatial: main = do print 1; print 2
12:35 handyc joined
12:35 <ertes> first print 1, then print 2
12:36 <spatial> ertes: do is significant there. You mean ?
12:36 benjamin2 joined
12:36 nighty- joined
12:36 <ertes> spatial: do is not relevant, it's just a syntactic convenience
12:36 <ertes> the point is that everything your program does starts from 'main'
12:36 <erisco> I don't know if showing something that looks vaguely like procedural programming is wise at this stage
12:36 <ertes> spatial: for all intents and purposes 'main' *is* your program
12:37 <ertes> (do c; d) happens to be the program that first runs the program c, then the program d
12:37 <erisco> eh, come on, you know that is misleading
12:38 <spatial> ertes: Missing something. My Haskell code has main. Java has main.
12:38 <ertes> everything else is just helper definitions that you refer to from main (either directly or indirectly)
12:38 <ertes> spatial: yeah, haskell's 'main' is pretty much the same idea as java's 'main'
12:39 ExpHP joined
12:39 <ertes> regarding order of operations you need to distinguish between two different things: evaluation (like computing the result of a function) and execution (IO actions)
12:39 <spatial> ertes: print 1; print 2 Is that sequential always ?
12:39 deepfire joined
12:39 <ertes> spatial: yes
12:39 <erisco> I can't watch, tell me how it ends up
12:40 <ertes> spatial: but consider this: print (2^8 + 3^8)
12:40 xanadu_ joined
12:40 <ertes> spatial: there is no defined order in which 2^8 and 3^8 will be evaluated
12:40 <ertes> the compiler is free to evaluate them in any order or even in parallel
12:41 <quchen_> ertes: While you’re here, I have a simple FRP question that I didn’t find a solution to. I tried writing an ASCII/console-based Snake using Reactive-Banana with a simple "ooooo" snake.
12:41 <quchen_> I want to render only if the game state changes, which is periodically, given by a tick event.
12:41 <quchen_> The problem now is that I want, on every tick, to advance the snake, and then render the updated snake. So not both rendering and moving can depend on the tick event directly, because then we’d always render a 1-frame-earlier snake, since they’re updated simultaneously.
12:41 <spatial> ertes: :-) I am used to Java memory models. Sorry. My question isn't asked properly.
12:41 <quchen_> So reacting on one event in two dependent places is something I wasn’t able to solve.
12:42 kritzcreek_ joined
12:42 mizu_no_oto joined
12:42 <quchen_> A solution to the problem above is just making the snake an event by fmapping/accumulating the time events, and then rendering on snake events.
12:42 <spatial> Compilers and core architectures realign boundaries.
12:43 <spatial> Data races and other races.
12:43 <quchen_> But that makes the problem less composable: what if I wanted to draw the snake’s head direction, "ooooo>" or "ooooov"? Then I could not create a snake event anymore, since events don’t combine (only Functor, not Applicative).
12:44 <ertes> quchen_: events combine, just not via Applicative
12:44 <quchen_> union f event1 event2?
12:44 augur joined
12:45 <ertes> quchen_: to combine events you need to choose between intersection and union (unionWith)
12:45 <quchen_> But even then, should the snake not be a behavior, rather than an event? The snake is somewhere at all points in time, after all.
12:45 <ertes> in fact i don't see a way to take event intersections in r-b, but i may be blind
12:45 <quchen_> I don’t recall intersections as well there. unionWith does union, at least.
12:45 <ertes> quchen_: the state of the snake is a behaviour, but a change of the snake is actually an event
12:45 kuribas joined
12:45 <erisco> quchen_, ertes can tell you more, but all I have to say on this is that it depends on the semantics
12:45 <ertes> quchen_: so it makes sense to have both
12:46 <ph88> what does that mean No instance for (MonadHttp IO) arising from a use of ‘req’ in https://bpaste.net/show/5729dbed12cb
12:46 <erisco> quchen_, the usual choice for simultaneous events is to be left-biased
12:46 <ertes> spatial: you shouldn't concern yourself with low-level details like that in haskell
12:46 <erisco> quchen_, so if you union two events, the left events come first
12:46 <geekosaur> ph88, you tried to use something specific to an HTTP monad when you only have IO
12:46 <quchen_> ertes: Ah, is that a thing? I thought having x-change-event and x-behavior alongside each other seemed like an antipattern.
12:46 systadmin joined
12:46 <ertes> quchen_: not at all… in fact in reflex there is a separate type for that =)
12:46 <ertes> quchen_: called Dynamic
12:47 <quchen_> erisco: unionWith in Banana is parameterized over the combination function
12:47 <ertes> it's like a behaviour, but coupled with a change event
12:47 <quchen_> unionWith :: (a -> a -> a) -> Event a -> Event a -> Event a
12:47 <ph88> geekosaur, in the example i don't see any more code that says anything about the HTTP monad .. it's the same code in main :: IO ()
12:47 <erisco> quchen_, well that leaves even more questions
12:47 <quchen_> ertes: Interesting. But let’s suppose we have that. What do we render when the snake updates?
12:47 <ertes> quchen_: the snake state behaviour
12:48 <quchen_> The snake behaviour? We can’t do that, since that hasn’t updated yet, has it?
12:48 <erisco> quchen_, so does it wait for a pair of events to arrive before combining?
12:48 <ertes> quchen_: let me check, if r-b supports that
12:48 <erisco> quchen_, the simpler union is <|>
12:48 <phadej> quchen_: you render a value of "behaviour", if it changes, re-render happens
12:49 <geekosaur> ph88, I loaded the page referenced in the paste and now I am checking if there are later versions than 0.2.0 that behave differently
12:49 <ertes> quchen_: as far as i can tell it doesn't, so you need to carry the new state of the snake along with the event, so you can use it in 'reactimate'
12:49 <geekosaur> hm apparently not
12:49 <erisco> this irks me about a lot of FRP-like libs out there
12:49 <ertes> quchen_: (it makes sense that it doesn't support that, because otherwise using MonadFix with the Moment* monads would be pretty dangerous)
12:49 <erisco> they'll have a function like unionWith and not indicate at all what it means
12:49 <erisco> it is ambiguous from the type alone
12:50 <ertes> erisco: that's why you read the name, too =)
12:50 <erisco> the name doesn't answer it for you either
12:50 <erisco> I can assume it is something like <|>, okay fine
12:50 <quchen_> Here’s an example event network of some of my clumsy snake event networks, for reference: http://lpaste.net/354056
12:51 <geekosaur> ph88, suggest you look at the documentation
12:51 <erisco> but it is not clear at all how the combining function is used i.e. what the output event is
12:51 <erisco> there at at least two sensible ways it could work
12:51 <geekosaur> ph88, look for "Examples" with a little box to the left of it, click the box
12:52 <erisco> one is to wait for a pair of events
12:52 <Juste1> exit
12:52 <spatial> http://lpaste.net/354055 Can playntimes complete before the following 'loop' is executed ? loop waits for the completion ?
12:52 <ertes> erisco: are you complaining that r-b is not exhaustively documented?
12:52 <erisco> not sure what r-b is
12:52 <ph88> geekosaur, yes those examples was what i was talking about
12:52 <ertes> erisco: reactive-banana
12:52 <geekosaur> ph88, did you see the very top of that section?
12:52 <geekosaur> where it talks about boilerplate?
12:52 <ph88> geekosaur, yes the import, i have them
12:52 <erisco> for functions like these? yes if it is not documented then it is a worthless function to me because I don't know what it does :P
12:53 <erisco> would have to boot it up in REPL and figure it out
12:53 <geekosaur> not just the import
12:53 <geekosaur> you need, in particular, the instance definition
12:53 <quchen_> Reactive-Banana has good function, but poor integration, documentation. Many examples in the lib’s own source are outdated as well. :-(
12:53 sea_wulf joined
12:53 <ph88> geekosaur, i have the instance definition, i have this working in a test project https://bpaste.net/show/678137ff3dda still figuring out why it doesn't work in the main project
12:53 <ertes> erisco: you're welcome to contribute
12:54 <erisco> ertes, you like the passive-aggressive don't you :P
12:54 <ph88> ok i just :r again and it works .. don't know what was wrong .. maybe didn't safe file :/
12:54 xanadu_ joined
12:54 <geekosaur> spatial, it's in IO so it is sequenced
12:55 <erisco> unionWith (,) [(t1,x1),(t3,x3)] [(t2,x2),(t4,x4)] == [((t1,x1),(t2,x2)),((t3,x3),(t4,x4))] that is one possibility
12:55 davama joined
12:55 davama left
12:55 <erisco> unionWith (,) [(t1,x1),(t3,x3)] [(t2,x2),(t4,x4)] == [((t1,x1),(t2,x2)),((t3,x3),(t2,x2)),((t3,x3),(t4,x4))] is another
12:55 <geekosaur> (there is a hidden data dependency injected by the IO monad to ensure things happen in order. in fact, that's *all* the IO Monad instance does.)
12:55 <erisco> so which is it? who knows
12:55 <spatial> geekosaur: Let me test. I do see something wrong.
12:55 <ertes> erisco: only one of those is not a type error
12:56 netheranthem joined
12:56 <ertes> actually, no
12:56 <ertes> they're both type errors =)
12:56 <quchen_> Depends on the type of unionWith.
12:56 <ertes> quchen_: the one from r-b
12:56 <quchen_> :: (a -> a -> a) -> Event a -> Event a -> Event a
12:56 <erisco> this one is a -> a -> a, okay, fair, but some others are not
12:57 <erisco> so I'll have to be more clever if this doesn't rule out the problem
12:57 <quchen_> Choose (+) instead of (,)
12:57 _sg joined
12:57 <ertes> erisco: right… now pick the least clever implementation, and that's the correct one ;)
12:57 <erisco> but my general complaint stands even if this example fell apart on me :P
12:57 <erisco> ertes, no, it isn't
12:57 <quchen_> I’d take a look at reflex if the docs weren’t so scary. :-(
12:58 <ertes> quchen_: what docs? =P
12:58 <quchen_> Also I’d like to understand why R-B is that limiting. Am I doing something wrong, or is the library?
12:58 <erisco> I might be able to be more clever and come up with an example like above, but lets go at a different property
12:58 <spatial> Maybe the printf statements aren't displayed properly.
12:58 <ertes> quchen_: the host API is severely underdocumented, but luckily you can learn it mostly from the types… that's how i did it
12:58 <quchen_> ertes: The author must have liked the sessions package.
12:58 <ertes> quchen_: and if you have any questions, feel free to ask
12:59 <geekosaur> spatial, what I see is you only ever invoke loop1 when numbins is 0
12:59 <geekosaur> so all it does is print "Finished"
12:59 <ertes> quchen_: the regular FRP API should be easy enough though, and is documented to some reasonable degree
12:59 <erisco> ertes, (I realise I also forgot to timestamp my 2-tuple events, whoops, but it would take the latest time of course
13:00 <quchen_> I thought R-B was very simple. Well, it is, but failing something this fundamental makes me mad, and I’m hoping I can be mad at someone else rather than myself.
13:00 sdothum joined
13:00 <geekosaur> this might be clearer if you hadn't reused the sane bindings later
13:00 ozgura joined
13:00 <erisco> unionWith const [(t1,x1),(t3,x3)] [(t2,x2),(t4,x4)] == [(t1,x1),(t1,x1),(t3,x3),(t3,x3)]
13:00 <geekosaur> *same bindings
13:00 <spatial> Right. Do I have to use a copy of the bindings using let ?
13:00 <erisco> sorry I got that wrong
13:01 <ertes> quchen_: with r-b i believe carrying around the snake state with the change event is your best bet
13:01 <erisco> unionWith const [(t1,x1),(t3,x3)] [(t2,x2),(t4,x4)] == [(t1,x1),(t2,x1),(t3,x3),(t4,x3)]
13:01 <quchen_> ertes: And with reflex it’s all rainbows and unicorns, on the condition I can decypher the spell to invoke them?
13:01 <geekosaur> oh, hm, maybe I misread that. it is certainly confusing with the reuse :/
13:01 <erisco> unionWith const [(t1,x1),(t3,x3)] [(t2,x2),(t4,x4)] == [(t1,x1),(t2,x2),(t3,x3),(t4,x3)]
13:01 <ertes> quchen_: pretty much =)
13:01 <quchen_> ertes: Curses.
13:02 <ertes> quchen_: http://lpaste.net/159333
13:02 <ertes> a very simple example application
13:02 <erisco> I'm not making these up (except my first mistake, which doesn't make much sense)
13:02 <quchen_> ertes: Hooray, just what I was looking for.
13:02 <erisco> they're real ways I could think they merge the events, in conjunction with the combinator
13:02 cpennington joined
13:02 <quchen_> Was about to ask for an example. Such as ummm Snake
13:02 <erisco> and I could likely come up with many more
13:02 <quchen_> type TickApp t m = (Reflex t, MonadHold t m, MonadSample t m) => Event t UTCTime -> m (Behavior t String)
13:02 <quchen_> ಠ_ಠ
13:02 <ertes> quchen_: read "delayUntil 1 t" as "threadDelay 1000000" and ignore the dependency on the timelike library
13:03 <ertes> quchen_: for now just think of 't' selecting the reflex implementation (yes, it does support having multiple implementations)
13:03 Fairy joined
13:04 <quchen_> Just like Haskell has »float« just in case someone wants to swap out the Float implementation. Oh wait. :-S
13:04 <quchen_> ertes: t = Spider?
13:04 <ertes> quchen_: a MonadHold can 'hold', a MonadSample can 'sample', that's the gist
13:04 <ertes> yeah
13:04 <quchen_> Just like MonadTrans can 'trans'.
13:04 <ertes> there is actually a good reason for doing that: testing… there is a purely functional implementation that implements the semantics, and the Spider implementation is tested against that
13:05 <erisco> and despite both those being good guesses I wouldn't be surprised if the real unionWith did something else
13:05 <quchen_> ertes: Okay, good point.
13:05 tlaxkit joined
13:05 <ertes> erisco: there is really a good semantics-related reason for having those two extra classes
13:05 <ertes> whoops
13:05 <erisco> this is just concerning Event
13:05 <ertes> quchen_: that was for you
13:05 <erisco> I get there are well-defined semantics
13:05 <ertes> erisco: ignore that =)
13:06 <erisco> the problem is that when you build on these to define more complicated functions like unionWith I don't know what you're doing
13:06 <ertes> quchen_: look at 'push' and 'pull'
13:06 <erisco> all I have is "works something like <|>" as a guess
13:06 <erisco> so, not a dig at any particular lib, just a general frustration I've had
13:07 dni joined
13:07 <ertes> erisco: well, i was serious: someone has to actually write this documentation, and it's not that easy to do
13:07 splanch joined
13:07 <erisco> it is just exacerbated with FRP more than other subjects, I find
13:07 <erisco> i.e. the relationship between the types and semantics
13:07 balor joined
13:08 zariuq joined
13:08 <ertes> i think heinrich has a blog with lots of FRP-related intro material
13:08 <erisco> there is so much wiggle room between the two, even when adding an intuition from the function name
13:08 <geekosaur> spatial, ok, so I see what it's doing now. what do you see it doing wrong?
13:08 fendor joined
13:08 KarboniteKream joined
13:09 <quchen_> ertes: Any further simple examples you could give me?
13:09 <erisco> I would be interested in seeing a more sophisticatedly typed FRP where it was clear from types alone how an event merge happens, for example
13:09 <erisco> and there are many other properties you may want
13:09 <quchen_> ertes: Something to read on the bus :-)
13:09 <ertes> quchen_: read the API
13:09 <erisco> such as this event produces a bunch of X terms then one Y terms and none after
13:10 <ertes> quchen_: the classes Reflex, MonadSample and MonadHold are the primitive classes
13:10 <ertes> everything else is defined in terms of them
13:10 <ertes> quchen_: also you should learn the dependent-sum and (optionally) the dependent-map libraries when working with reflex
13:11 Rainb joined
13:11 <ExpHP> How can I comfortably extract a multidimensional array from JSON without it looking like the spawn of sin?
13:11 funkshun joined
13:11 <lpaste_> ExpHP pasted “uh-oh-json” at http://lpaste.net/354057
13:12 <quchen_> Dependent-sum? As in Σ types?
13:12 <ExpHP> notice: although I am using lenses, I am actually a complete noob who's just throwing stuff at the screen till it typechecks
13:12 <quchen_> Eh nevermind, that’s a pair.
13:12 <ertes> quchen_: almost, yeah
13:13 <ertes> quchen_: not full sigma, but the subset of it that haskell's GADTs and type refinement can represent
13:13 <quchen_> What’s a dependent sum? A dependent function is Π, a dependent pair is Σ
13:13 <ertes> "dependent pair" and "dependent sum" are the same thing
13:13 <erisco> ExpHP, you shouldn't play with magic you don't understand; you may hurt yourself
13:13 <quchen_> Ah, okay.
13:14 nitrix_ joined
13:14 <erisco> ExpHP, next minute a passerby starts vomiting slugs and you've got a lawsuit
13:14 <ExpHP> erisco true but using Aeson itself is even scarier
13:14 dni joined
13:14 <ExpHP> (most of Aeson is centered around the serialization/deserialization of datatypes with typeclasses, which I really would like to avoid)
13:14 detrumi joined
13:15 <puregreen> ExpHP: you can perfectly use it without typeclasses, just write serializing functions by hand using `object`, `array`, etc
13:16 feynhat joined
13:16 <ertes> quchen_: the dependent-map library is optional and honest a bit of a mind-bend as well as horrible to use, but luckily it's possible to avoid having to use it =)
13:17 Rainb joined
13:17 carlomagno joined
13:17 quchen joined
13:17 <quchen> Grr, internet broke. Last thing I saw was »sum = pair« from Ertes.
13:17 <ertes> quchen: the dependent-map library is optional and honest a bit of a mind-bend as well as horrible to use, but luckily it's possible to avoid having to use it =)
13:18 <ertes> you mostly need it for efficiency reasons, but snake won't need it, so feel free to learn it as you need it
13:18 <erisco> I want to be told "it gets better" before I spend my time
13:18 <ExpHP> I can't find any examples in the Data.Aeson docs of deserializing an array. They're all examples of objects
13:19 <geekosaur> a json object is either a hash or an array
13:19 dbmikus joined
13:19 <erisco> like Haskell, it gets better :)
13:19 ebzzry joined
13:19 eschnett joined
13:20 <ExpHP> oh, hm, okay I just found some type parsing combinators in there (withArray, withNumber, etc.). Maybe this can work...
13:21 xtreak joined
13:21 <erisco> ertes, I tried writing some docs in my own code for such-like functions and it is a PITA to be precise about it
13:22 <ph88> how can i put the right HTTP Content-Type based on a file ?
13:22 Rainb joined
13:22 <ertes> erisco: one immediate improvement is to write equations
13:23 <ertes> unfortunately to really specify the behaviour of 'unionWith' requires equations in terms of an observation function, which does not exist as a concrete function in the API
13:23 <erisco> if there was an established formality for it then it would be easier
13:23 <ertes> but it would be good enough as a model
13:23 <erisco> I did some things with diagrams
13:24 dni joined
13:24 mda1 joined
13:24 <ertes> observe t (unionWith f xs ys) | occurs t xs, occurs t ys = f <$> observe t xs <*> observe t ys | …
13:24 <ertes> something like that
13:25 zcourts_ joined
13:25 bjz joined
13:25 <ertes> 'observe' exists in the semantics, but it can't be implemented for the real thing
13:27 dfeuer joined
13:28 <ph88> what's the haskell equivalent of https://secure.php.net/manual/en/function.mime-content-type.php ?
13:28 Denthir joined
13:29 <Booba> ertes: Is it true to state that the idea behind Tenderman datatype in http://community.haskell.org/~ertes/hangman/ is that games state represents current challenge and possible moves from that point?
13:29 <erisco> this http://hackage.haskell.org/package/acme-php
13:29 <ertes> Booba: yes
13:29 <merijn> ph88: You want bindings for libmagic, I think?
13:29 <Booba> ertes: If so, is there a way to scale this approach to other problems?
13:29 <ertes> Booba: yes
13:29 <ph88> merijn, libmagic ?
13:29 <Booba> ertes: IOW, how do I identify problems that are solvable this wa?
13:30 Yuras joined
13:30 <merijn> ph88: It's a C library for detecting the filetype of a file
13:30 <ertes> Booba: i'm running out of time, so i can't explain in depth, but the idea is: Tenderman is really a special case of a more general state machine
13:30 <merijn> ph88: Which, judging by the PHP docs you linked is used by PHP too
13:30 CDag joined
13:30 <ph88> merijn, doesn't neccesarily need to be a C library .. it just need to make as good a choice of MIME type as possible
13:30 <ertes> Booba: and there are ways to write composable abstractions for state machines
13:30 <erisco> or as ertes complained earlier: state machines can do everything, so they're nothing
13:30 umib0zu joined
13:30 <riaqn> Hi, how to represent "a series of operation on an Array"?
13:31 <riaqn> like State (Array i a)
13:31 <Booba> ertes: I see. I can imagine a state machine as some state and ways do modify it, as in challenge and move in the example.
13:31 <erisco> maybe an uncharitable paraphrase :P
13:31 <ertes> Booba: yeah, exactly
13:31 <ph88> merijn, on line you can also type file -bi my_file.txt and it will tell you text/plain; charset=us-ascii
13:31 <Booba> ertes: thanks! That was really helpful!
13:31 <merijn> ph88: file uses libmagic
13:31 <quchen> riaqn: By composing functions, op3 (op2 (op1 array))
13:32 <erisco> <ertes> "looking like a state machine" is not a useful way to categorise
13:32 prophile joined
13:32 <quchen> riaqn: There’s also the (ST s) type for inplace updates, famously used to implement Quicksort like in C
13:32 <riaqn> quchen: don't know if that's what I want...
13:32 hhf joined
13:32 <quchen> I don’t know whether that’s what you want either :>
13:32 <erisco> well I disagreed with that and still do, let me quote the other one
13:32 <riaqn> quchen: yes, please tell me more about ST.
13:32 ozgura joined
13:32 augur joined
13:32 <erisco> <ertes> erisco: if you look close enough, this code looks like a state machine, too: [1..]
13:33 <quchen> (ST s) is a limited version of IO, with which you can compose impure functions (such as in-place updates) and then seal it, making the entire thing a pure computation.
13:33 <riaqn> more specifically, what the type for "run some computation that may modify an Array, and return a"
13:33 <Booba> erisco: state machine is a well-known problem, on the other hand, and it is nice to know how you could approach it in haskell
13:33 <erisco> yes, you can construe anything into a state machine
13:33 tabaqui1 joined
13:33 <erisco> so if you actively look for state machines it is kind of the "everything looks like a nail" mistake
13:34 <ExpHP> okay so apparently this is all I had to do:
13:34 <ExpHP> (decode "http://en.wikipedia.org/wiki/Special:Search?go=Go&search=[1,0],[0,1]],[[3,4]") :: Maybe http://en.wikipedia.org/wiki/Special:Search?go=Go&search=[Integer]
13:34 <ExpHP> wtf
13:34 peterbec` joined
13:34 <ExpHP> that is not what I copied
13:34 <erisco> that said, if you have a problem which naturally lends itself to being represented as a directed graph (with whatever labeling) then a state machine may be a convenient model
13:34 <ExpHP> (decode "http://en.wikipedia.org/wiki/Special:Search?go=Go&search=[1,0],[0,1]],[[3,4]") :: Maybe http://en.wikipedia.org/wiki/Special:Search?go=Go&search=[Integer]
13:35 <ertes> erisco: i think i tried hard enough to communicate my point and failed often enough
13:35 ExpHP_ joined
13:35 mson joined
13:35 <ertes> so i'm not gonna respond to that particular topic anymore
13:35 <quchen> > runST (do {ref <- newSTRef 1; modifySTRef' ref (+1); readSTRef ref}) -- This performs an in-place mutable update on the »ref« variable.
13:35 <lambdabot> 2
13:35 <quchen> riaqn ^
13:35 <riaqn> quchen: but the state used has to be initialized in the ST monad? cannot pass in.
13:35 <ph88> merijn, do you think i'm better of with the bindings instead of using a haskell package like https://github.com/yesodweb/wai/tree/master/mime-types ?
13:35 <erisco> ertes, I am just sharing your points
13:35 <ph88> here is another potential package https://github.com/knrafto/email-header
13:35 <merijn> ph88: No, I just wasn't aware if that existed
13:36 <quchen> riaqn: (ST s) has no state that you can (or may want to) modify, no.
13:36 <ertes> erisco: you're misrepresenting them, and acting like a dick along the way as well… it's irritating and a waste of time
13:36 ystael joined
13:36 <quchen> riaqn: Vector (Haskell’s array library) has modules to work with mutable arrays. It supports indexing and all the array things.
13:36 <quchen> And writing, in particular ;-)
13:36 <erisco> ertes, well that's how I understood them, sorry
13:36 <merijn> Lens afficionados: Is there a 'preview' which works for Applicatives?
13:37 <riaqn> quchen: yeah, thanks. I want to make it more clear: I'm kind of looking for some faster alternative for (State (IArray i a) x)
13:37 <merijn> Basically, I have "preview (ix n) >>= \case" currently, but I would likely to replace that with something that only requires Applicative
13:37 crobbins joined
13:37 oisdk_ joined
13:38 <Gurkenglas_> :t preview
13:38 <lambdabot> MonadReader s m => Getting (First a) s a -> m (Maybe a)
13:38 <Gurkenglas_> You want something that looks like "(MonadReader s m, Applicative f) => Something -> m (f a)"?
13:38 ziocroc joined
13:39 <merijn> Gurkenglas_: I have ReaderT over an Applicative
13:39 <ExpHP> Okay, now that I think I've taught Konversation to behave:
13:39 certainty joined
13:39 <ExpHP> this is all I had to do: (decode "[[[1,0],[0,1]],[[3,4]]]") :: Maybe [[[Integer]]]
13:39 <Booba> ertes: this reminded me of https://www.infoq.com/articles/webber-rest-workflow, the way they design a REST API is similar: every response represents a current state of your order and carries possible future steps
13:39 <* ExpHP> thanks Konversation for being cooperative this time
13:39 polux joined
13:40 <Gurkenglas_> merijn, you want something that looks like "Applicative f => Something -> ReaderT s f a"?
13:40 chlong joined
13:41 <merijn> Oh, wait, I think I know how to deal with this
13:41 <Gurkenglas_> *ReaderT s f (Maybe a), of course
13:41 <Gurkenglas_> Glad to help? :P
13:42 <ertes> Booba: not sure if that's really comparable (because REST is inherently mutable), but i can't read the full article right now
13:42 sphinxo joined
13:42 <riaqn> quchen: thanks.. I think it's just (MArray a e m) => m x
13:43 <quchen> λ. V.modify (\vec -> do { a <- VM.read vec 1; b <- VM.read vec 0; VM.write vec 1 b; VM.write vec 0 a }) (V.fromList [1..10])
13:43 <quchen> riaqn: That swaps the first two elements of a (mutable) vector inplace.
13:43 <merijn> Gurkenglas_: No, I have Validation atm, but it should be possible to convert the Maybe from preview to Validation
13:43 <riaqn> quchen: thanks! new stuff learned.
13:43 <erisco> Booba, yes it is loosely similar to that
13:44 cpup joined
13:44 <quchen> riaqn: Array is a bit outdated, I suggest you give Vector a look.
13:44 <quchen> But it supports mutable updates as well.
13:44 <riaqn> quchen: OK! I will try that.
13:44 <quchen> Vector’s modify is pretty much the only function I’ve ever needed ;-)
13:44 <erisco> the mutable part of REST is not relevant if we're just talking about a transaction, i.e. something that may lead to a mutation but isn't mutating along the way
13:45 vektorweg1 joined
13:46 <riaqn> quchen: wow, vector seems much more complicated than Array
13:46 zcourts joined
13:46 <quchen> Really? I think it just has a much richer API. I find it easier to use.
13:46 <fendor> no, it is actually quite simple
13:46 <riaqn> Is it just an advanced version of Array with more batteries?
13:46 igmufdnzz joined
13:47 <quchen> Yup.
13:47 <fendor> riaqn, disagree with this one, since you can only access via int
13:47 <erisco> that just means it is power-inefficient
13:47 <fendor> but useful
13:47 <erisco> vector does give up the parametric indices
13:47 <riaqn> ahh, that's not nice.
13:47 <erisco> or polymorphic indices, or whatever word is appropriate =\
13:48 <quchen> You can use Ix to index a Vector as well.
13:48 <riaqn> guess because the implementation utilize some machine optimization?
13:48 danza joined
13:48 <fendor> and nested vector dont look nice
13:48 <riaqn> so it has to be the machine Int.
13:48 takle joined
13:48 CDag left
13:48 <fendor> riaqn, the implementations uses fusion, and can chain several operations into one
13:48 <fendor> this is highly optimized
13:48 danthemyth joined
13:48 <merijn> Gurkenglas_: Gah, not quite >.< just "preview (ix n)" has my applicative type, so I don't think I can do it >.<
13:49 <riaqn> fendor: hmm.. guess for now I will just use Array.
13:49 <riaqn> loss of parametricity of Index is not nice.
13:49 <fendor> riaqn, it's slower, if you need performance, vector is the right choice
13:50 <merijn> Gurkenglas_: Since if I have "ReaderT (Map k v) (Validation e) a" preview produces that type and I can't convert the Maybe, I think
13:50 <riaqn> yeah, understand that.
13:50 <riaqn> I will see if I need more performance.
13:50 <erisco> heck, if you don't care about performance just use a list ^.^
13:50 mizu_no_oto_work joined
13:50 <fendor> riaqn, yes, it should be rather easy to convert the code
13:50 <merijn> Or, it might be possible, but not using preview, I need something else
13:50 <fendor> erisco, he wants the polymorphic access ^^
13:51 <riaqn> well.. MArray to list is not the same complexity when it comes to random access and modification.
13:51 <quchen> > Data.Ix.index ((1,1),(4,4)) (2,3) -- The index of (2,3) in coordinates (1..4, 1..4).
13:51 <lambdabot> 6
13:51 <quchen> Tadaa, non-linear indexing.
13:51 PennyNeko joined
13:51 <riaqn> but Array and Vector, should be on the same level.
13:51 <riaqn> I mean, the big-O notation.
13:51 dni joined
13:52 <quchen> Up to a constant that can be greater than the lifetime of the universe in nanoseconds, their performance is equal, exactly.
13:52 <fendor> riaqn, vector can optimize certain operations. For example, several map are just fused into one. More efficiently than with normal laziness
13:52 MindlessDrone joined
13:52 Rodya_ joined
13:52 <erisco> quchen, shh, how dare you attack the pragmatism of asymptotics!
13:53 robotroll joined
13:53 <riaqn> fendor: so you mean in some cases the optimization factor is unbound?
13:53 <* quchen> has never never seen an asymptotic value so I don’t believe in their usefulness in practice
13:54 roundhouse joined
13:54 nitrix_ joined
13:55 hhf joined
13:55 mmachenry joined
13:56 gbfrow joined
13:57 <fendor> riaqn, well no, the complexity remains, but in practice, the performance can be greatly improved
13:58 <fendor> riaqn, from O(4*n) to O(n)
13:58 <fendor> for exmaple
13:58 <erisco> that's strange, I read the same thing twice there
13:59 <quchen> That’s a factor four improvement! It’s not much less linear asymptotically.
14:00 <quchen> s/not/now/
14:00 vektorweg1 joined
14:01 balor joined
14:01 <merijn> quchen: Reduction from O(4*n) to O(n) *is* asymptotically better
14:02 sea_wulf joined
14:02 robkennedy joined
14:02 e14 joined
14:02 <quchen> Yes, the first one is more linear.
14:02 <opqdonut> merijn: false, O(4*n) = O(n)
14:02 <quchen> »Linearer«, in mathematical terms.
14:02 <quchen> It’s like linear, but more so.
14:02 louispan joined
14:03 simukis_ joined
14:03 <quchen> OK I’ll stop ;-)
14:03 cdg joined
14:03 <merijn> quchen: Prepare to be schooled: "A function 'f' is asymptotically better than a function 'g' if there exist an a value X, such that for every value y >= X, f(X) is better than g(X)"
14:03 boombanana joined
14:03 mada joined
14:03 burtons joined
14:03 <opqdonut> merijn: reduction of running time from O(n) to n+o(n) can be thought of as asymptotically better, however
14:03 <quchen> I thought I had just seen a big-O there. I must have misread.
14:04 <merijn> A function that is 4n vs n is trivially asymptotically better
14:04 <opqdonut> merijn: or from 4f(n) to f(n), of course
14:04 <merijn> The big O is wrong, yes
14:04 <quchen> Functions aren’t 4n. Functions can be element of O(4*n). And iff they are, they are also element of O(n).
14:04 <merijn> i.e. O(4*n) is indeed equivalent to O(n)
14:04 <riaqn> fendor: OK I see.
14:04 Miroboru joined
14:05 <merijn> quchen: But reducing a function from 4 traversals to 1 *is* asymptotically better
14:05 <merijn> quchen: Since if it's better for ALL inputs, it's trivially the case that it's better for all inputs >X for some value X
14:05 <merijn> People seem to always assume "asymptotically" == change in O class
14:06 <merijn> Functions in the same O class can still be asymptotically better
14:06 <quchen> We talked about »O«, so I seemed to assume we talked about O classes.
14:06 feynhat joined
14:06 KarboniteKream joined
14:06 <kuribas> isn't O simply an upper bound?
14:06 <merijn> quchen: Well, it's clear that if someone writes O(4*n) their use of O() is garbled, but still understandable
14:06 <kuribas> not the lowest upper bound?
14:07 <erisco> if I could remember the course it was in I would drag out my notes on the formalisation
14:07 <merijn> kuribas: Lower bound
14:07 <erisco> but I am sure it varies slightly depending on who you ask =\
14:07 umib0zu joined
14:07 cdg joined
14:07 <merijn> kuribas: Eh, no upper bound :)
14:07 <fendor> guys, youre overreacting :D
14:07 <merijn> you're right
14:07 <fendor> *guys and girls
14:07 <merijn> erisco: Well, there's actually correct definitions. And various wrong ones found on the internet :)
14:08 <* quchen> now starts measuring voltage in apere because it’s garbled, but still understandable.
14:08 `^_^v joined
14:08 <kuribas> fendor: it's a mathematical construct. If you use it wrongly it becomes meaningless.
14:08 <merijn> erisco: If you wanna be factually correct, I recommend grabbing a copy of CLSR
14:08 takle joined
14:08 <merijn> @where CLSR --does this exist?
14:08 <lambdabot> I know nothing about clsr.
14:08 conal joined
14:08 <erisco> merijn, or I can just grab my course notes like I said
14:08 <merijn> hmmm
14:09 koodailar joined
14:09 <fendor> kuribas, *sigh* i'm aware that this was not the right notation, it was to explain an example in short
14:09 <dolio> CLRS?
14:09 feynhat joined
14:09 <mfukar> saying a f(n) is O(n) and O(4*n) can be technically correct, but only one of those statements is useful
14:09 <merijn> dolio: Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein
14:10 <dolio> Right, you had the S and R transposed, though. Although I doubt CLRS is in lambdabot, either.
14:10 deepfire joined
14:10 eacameron joined
14:10 <merijn> mfukar: Well, no, "O(4*n)" is patently absurd as you cannot have constants in big O notation
14:10 <merijn> dolio: Damn, I even googled to check >.>
14:10 <merijn> oh, google auto corrected :)
14:11 <merijn> Bastards
14:11 <mfukar> you have functions. g(n) = c*n is a function.
14:11 <dolio> Google lists the authors LSRC, even when you search for CLRS.
14:11 dylukes joined
14:12 feynhat joined
14:12 eacamero_ joined
14:12 meandi joined
14:12 <erisco> merijn, I don't actually recall any syntactical issue with O(4*n)
14:12 <erisco> merijn, it just washes out the same as O(n)
14:12 ChristopherBurg joined
14:12 Fairy joined
14:12 <fendor> merijn, you can say O(4*n) but normally no one uses it, since it has the same meaning as O(n)
14:13 <erisco> you're just sticking any ol' function in there
14:13 <fendor> my initial usage was indeed wrong, i should ve used theta(4*n) reduced to theta(n)
14:14 <kuribas> O isn't a measure of performance, but of scalability
14:14 meba joined
14:14 <fendor> O is a measure of algorithmic complexity
14:14 eacamer__ joined
14:14 feynhat joined
14:15 cpup joined
14:15 <erisco> kuribas, it is just to be pointed out that the benefits of that scalability may not be observable
14:15 <fendor> therefore also for scalability, with inherit impacts on performance
14:15 <kuribas> erisco: right, and it depends on the variables used.
14:16 augur joined
14:16 dsh joined
14:16 ziocroc joined
14:18 <erisco> are there algorithms which become faster the larger the input? hm
14:18 eacameron joined
14:18 <fendor> relatively, yes
14:18 <fendor> compared to others
14:19 <erisco> I just mean it is somewhat curious that cost functions are monotonically increasing to input size
14:19 Kreest__ joined
14:19 mda1 joined
14:19 <erisco> seems obvious but at the same time what is the absurdity of otherwise? I am not so sure
14:19 <fendor> well, if you use theta notation, yes, there are functions that get faster
14:20 Sh4rPEYE joined
14:20 eacamero_ joined
14:20 Denthir joined
14:22 hhf joined
14:22 splanch joined
14:22 dylukes joined
14:23 <Gurkenglas_> There are no functions with strictly monotonically decreasing runtime, because you need time to find out how large the input is
14:23 <Gurkenglas_> If you don't, you can't act differently for large inputs and larger inputs
14:24 <erisco> that seems on track for an answer, but determining the exact size of input is not necessary for all algorithms
14:24 ludat joined
14:24 <mniip> then you have to detach from the turing machine computation model
14:25 <Gurkenglas_> No, there are turing machines that don't look at the size of the input. They just act identically for all inputs with some prefix.
14:25 <mniip> that's not useful
14:25 <erisco> I mean, for example, binary search
14:25 <mniip> yeah, a pointer machine can actually execute sublinear algorithms
14:25 <mniip> unlike TM
14:25 <Gurkenglas_> It's not useful, but the uselessness of that is a theorem, and that runtimes arent monotonically decreasing follows from that theorem
14:26 <mniip> then you need to correct your theorem
14:26 <erisco> and the truth seems stronger than monotonically decreasing
14:26 <erisco> as I said, it seems to be exclusively monotonically increases
14:26 <Gurkenglas_> How does a pointer machine execute sublinear algorithms?
14:26 <mniip> There are no functions with strictly monotonically decreasing TM runtime
14:26 <mniip> erisco, there are O(1) languages
14:27 <mniip> the language of all words, or a finite language
14:27 <erisco> that qualifies as monotonically increasing though
14:27 <mniip> non-strictly
14:27 <erisco> sure
14:27 <Gurkenglas_> erisco, an algorithm can take O(n!) time for even n and O(2^n) for odd n
14:27 <mniip> also no
14:27 <mniip> I'm sure I can come up with an algorithm that goes in a zigzagwise pattern
14:28 <mniip> not contrived one too
14:28 ebzzry joined
14:28 <erisco> mniip, your "no" is to what?
14:28 <mniip> there are non-monotonic algorithms
14:29 <Gurkenglas_> Just take that thing where you try to bruteforce whether "even numbers get halved, odd n get 3n+1'd, iterate until at 1" lands at 1. Very zigzaggy.
14:29 <erisco> well I think Gurkenglas_ gave a simple one
14:29 <erisco> though I'd restate it as True does one algo and False another
14:29 <erisco> switch between bogo and merge sort, for example
14:29 grayjoc joined
14:29 mda1 joined
14:29 <erisco> well I guess the Nat is necessary so you can talk about increasing input sizes
14:30 <erisco> though maybe something is off if we're just concerned about the evenness or oddness of the number
14:30 elvisren joined
14:30 <erisco> that is what made me reduce to bool
14:30 <Gurkenglas_> Actually the argument against strictly monotonically decreasing runtimes is that there are no strictly monotonically decreasing infinite natural sequences. :s
14:30 <erisco> Gurkenglas_, Collatz Conjecture
14:32 <Gurkenglas_> erisco, sure, but that's not proven, and the bruteforce thingy would disprove it for some n if it's false :P
14:32 teto joined
14:32 <erisco> I didn't say it was true oO
14:32 <Gurkenglas_> Then whatfor the namedrop?
14:32 <erisco> you called it "that thing"
14:32 fendor joined
14:33 <Gurkenglas_> Coz the reader might not know that name so I just described it in a line or so so ppl dont have to go google to follow the conversation
14:33 sheaf_ joined
14:34 <erisco> well I rarely know the name of something so I couldn't resist
14:34 djellemah joined
14:35 takle joined
14:35 <erisco> so with an absolute cost I can see quite simply how it may not be monotonically increasing
14:35 <erisco> those are good examples
14:35 <erisco> then the interesting case is strictly monotonically decreasing as you said
14:35 xall_ joined
14:36 peterbec` joined
14:36 robotroll joined
14:36 ragepanda joined
14:36 ekinmur joined
14:37 <erisco> Gurkenglas_, ah, I see, because the absurdity is that whatever the initial cost is, by increasing the size of input you reach the contradiction of infinite descent
14:38 dargains joined
14:38 unbalancedparen joined
14:39 niko joined
14:40 raycoll joined
14:42 coltfred joined
14:43 mizu_no_oto_work joined
14:43 sheaf joined
14:43 marsam joined
14:43 robotroll joined
14:44 mmn80 joined
14:46 sellout- joined
14:48 ragepanda joined
14:48 nwf joined
14:48 moongazer joined
14:49 etehtsea joined
14:49 moongazer joined
14:50 sanett joined
14:51 moongazer joined
14:51 xall joined
14:51 moongazer joined
14:53 sepp2k joined
14:53 Claudius1aximus joined
14:54 JeanCarloMachado joined
14:55 <teto> is there a way to have a local hoogle return the docstring associated with the search (instead of just the function signature) ?
14:56 dogukan joined
14:56 <dogukan> hi
14:56 dylukes joined
14:58 bollu joined
14:58 <dogukan> i am trying to write a function that finds all sub-lists of a given list with two elements, for example, if i give [1,2,3,4,5] to this function, i want to see [[1,2],[1,3],[1,4],[1,5],[2,3],[2,4],[2,5],[3,4],[3,5],[4,5]] as output
14:58 <dogukan> i wrote this function subset list = [[x,y] | x <- list, y <- list, x /= y]
14:59 <dogukan> but this gives for example both [1,2] and [2,1]
14:59 <dogukan> output of my function is [[1,2],[1,3],[1,4],[1,5],[2,1],[2,3],[2,4],[2,5],[3,1],[3,2],[3,4],[3,5],[4,1],[4,2],[4,3],[4,5],[5,1],[5,2],[5,3],[5,4]]
15:00 <dogukan> how can i eliminate those unnecessary lists?
15:00 <lyxia> don't pick x and y independently.
15:00 Big_G joined
15:01 <lyxia> when you pick x, also get the possible associated y at the same time
15:01 eazar001 joined
15:01 <lyxia> > let list = [1..4] in [[x, y] | x : ys <- list, y <- ys]
15:01 <lambdabot> error:
15:01 <lambdabot> • Ambiguous type variable ‘t0’ arising from a use of ‘show_M114171945873...
15:01 <lambdabot> prevents the constraint ‘(Show t0)’ from being solved.
15:01 <lyxia> > let list = [1..4 :: Int] in [[x, y] | x : ys <- list, y <- ys]
15:02 <lambdabot> error:
15:02 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘[t]’
15:02 <lambdabot> • In the pattern: x : ys
15:02 <lyxia> > let list = [1..4 :: Int] in [[x, y] | x : ys <- tails list, y <- ys]
15:02 <lambdabot> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
15:02 <lyxia> phew
15:02 <dogukan> oh i liked this bot
15:03 uglyfigurine joined
15:03 <lyxia> Do you not like it anymore?
15:03 ClaudiusMaximus joined
15:03 MitchellSalad joined
15:04 Denthir joined
15:04 <dogukan> lol :D i mean this is my first time on this channel and i am impressed with this bot now
15:04 psychicist__ joined
15:04 <lyxia> jk
15:05 earldouglas joined
15:05 cdg_ joined
15:06 mariano__ joined
15:06 coot joined
15:07 <dogukan> lyxia: when i try to run your code, hugs gives "ERROR - Undefined variable "tails"", i am a complete beginner so excuse me if this is a dump problem :D
15:08 <geekosaur> @index tails
15:08 <lambdabot> GHC.OldList, Data.List, Data.ByteString.Lazy, Data.ByteString.Lazy.Char8, Data.ByteString, Data.ByteString.Char8, Data.Sequence
15:08 kubrat joined
15:08 <geekosaur> you need to import Data.List
15:08 inad922 joined
15:08 bob_ joined
15:08 <dogukan> oh ok than
15:09 joneshf-laptop joined
15:10 <bob_> Hello
15:10 osa1 joined
15:10 osa1 joined
15:11 fizruk joined
15:12 bob_ joined
15:13 balor joined
15:13 Itkovian joined
15:17 al-damiri joined
15:17 Glooomy joined
15:17 <dogukan> @index in
15:17 <lambdabot> bzzt
15:17 <dogukan> :D
15:18 igniting joined
15:18 <geekosaur> it's syntax. let {<bindings>} in <expression>
15:19 <dogukan> hugs says Syntax error in input (unexpected keyword "in") so tried my chance :P
15:19 fosskers joined
15:20 SpinTensor joined
15:22 cods joined
15:22 theelous3 joined
15:22 raycoll joined
15:22 Rodya_ joined
15:23 <dogukan> oh i saw my stupid erros and understood the syntax
15:23 <dogukan> thank you everynone
15:23 Sh4rPEYE joined
15:23 <Myrl-saki> What does Wadler mean about fix? http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf
15:25 Mickael joined
15:26 phaji joined
15:26 <lyxia> Myrl-saki: is there something more specific you don't understand
15:27 ozgura joined
15:28 serendependy joined
15:28 Rodenbach joined
15:29 {emptyset} joined
15:31 doomlord joined
15:31 refold joined
15:32 oberstein joined
15:35 roundhouse left
15:36 _sras_ joined
15:37 Luke joined
15:37 <_sras_> I was trying to integrate swagger with my Webapplication in Servant while I get this error http://lpaste.net/2307787169109901312
15:37 raichoo joined
15:37 peterbec` joined
15:38 <_sras_> Any idea what I might be doing wrong?
15:38 <fizruk> _sras_: see https://github.com/GetShopTV/swagger2/issues/86
15:38 mohsen_ joined
15:39 osa1 joined
15:39 osa1 joined
15:39 kostja joined
15:40 jao joined
15:40 oberstein joined
15:41 <_sras_> fizruk: Thanks.
15:41 dargains joined
15:41 <kostja> Hello! I have two local projects A and B, where B depends on A. If I want to load a file from B in ghci, I get the error "Failed to load interface for ... perhaps you haven't installed the dyn libraries for package ..."
15:42 KarboniteKream joined
15:42 <kostja> (I am using nix and Gonzales haskell-nix approach to introduce B to A)
15:44 MitchellSalad joined
15:45 govg joined
15:45 mariano__ joined
15:47 pera joined
15:48 zero_byte joined
15:50 ortmage joined
15:50 orphean joined
15:51 <bollu> cocreature: ping
15:51 <cocreature> bollu: pong
15:51 <bollu> I need help getting llvm-general running with Stack
15:51 <cocreature> bollu: use llvm-hs :P
15:51 <bollu> cocreature: also, were you at euroLLVM?
15:51 <bollu> cocreature: :P
15:51 <cocreature> nope I didn’t have time
15:51 <bollu> cocreature: does it have JIT?
15:51 MitchellSalad joined
15:51 snowalpaca joined
15:51 <bollu> cocreature: ah, dang. I was hoping to have run into you without knowing it :)
15:52 <cocreature> bollu: I’m only half kidding, llvm-general is pretty much dead. just look at the commits. there is a reason we created a fork
15:52 <bollu> cocreature: I asked around quite a bit about STG -> haskell. there was a cool talk where they did Java -> LLVM
15:52 <cocreature> bollu: stg -> haskell? why would you want to transform stg to haskell?
15:52 <bollu> cocreature: we really should talk about this in depth sometime. I'm trying to understand STG fully by doing this: http://github.com/bollu/simplexhc
15:53 <bollu> cocreature: STG -> LLVM*
15:53 <cocreature> bollu: ah that makes a lot more sense :)
15:53 <cocreature> bollu: going back to your question: what problems are you encountering with llvm-general?
15:53 <bollu> cocreature: "stack build" does not work out of the box xD I didn't check what is going wrong, hoping you would know
15:54 <cocreature> bollu: which branch are you using?
15:54 <bollu> cocreature: llvm-general? whatever is on Hackage, I assume
15:54 <bollu> cocreature: let me use llvm-hs
15:54 <cocreature> bollu: that’s ancient. if you really want to stick to llvm-general at least use the 3.8 or 3.9 branch
15:54 <bollu> cocreature: I see
15:55 dni joined
15:55 <cocreature> bollu: the first thing is to make sure you are actually using the right LLVM version
15:55 <bollu> cocreature: I am on the latest. I run nightly
15:56 <bollu> cocreature: is that "too new"?
15:56 <cocreature> bollu: yep. llvm-general requires 3.5, llvm-hs requires 4.0
15:56 <cocreature> bollu: llvm breaks their API all the time, so there is no way to support multiple versions in one version of the Haskell bindings
15:56 <bollu> cocreature: I see
15:57 <bollu> cocreature: is there a way to "sandbox" the older llvm only for llvm-hs?
15:57 <bollu> cocreature: I really need to run the nightlies for my work stuff
15:57 <cocreature> bollu: which os?
15:57 <bollu> cocreature: mac os
15:57 <geekosaur> build llvm yourself in some nonstandard location?
15:57 <bollu> geekosaur: yes, I suppose
15:57 <cocreature> just use CMAKE_INSTALL_PREFIX
15:57 <bollu> cocreature: ah, OK
15:57 <cocreature> and then set PATH appropriately
15:58 sophiag joined
15:58 <bollu> cocreature: so I will need to change $PATH when I am working on this? bummer
15:58 <bollu> cocreature: or wait, this is only once for linking?
15:58 inerkick joined
15:58 ertes joined
15:59 <cocreature> bollu: only for building & linking llvm-hs/llvm-general
15:59 iomonad joined
15:59 <bollu> cocreature: ah OK
15:59 <cocreature> bollu: they look at the output of llvm-config to figure out where your llvm installation lives
15:59 orphean joined
15:59 <cocreature> bollu: so llvm-config needs to resolve to the right version
15:59 ozgura joined
16:00 <sophiag> is there a library that provides data types for storing lambda expressions? i'm thinking something similar to quoting in lisps and then you could provide the specific type signature when actually applying them in functions.
16:00 <cocreature> bollu: fwiw I use those flags to build & install llvm in a custom directory http://sprunge.us/CgjA
16:01 <bollu> cocreature: ty
16:01 <bollu> cocreature: I am trying to find the correct commit number for llvm 4.0
16:01 <bollu> cocreature: any idea where I can find it?
16:01 Noldorin joined
16:02 mounty joined
16:02 <cocreature> bollu: just download the tarball from the website?
16:02 <bollu> cocreature: eh, I suppose.
16:03 trism joined
16:03 lukaramu joined
16:04 <cocreature> bollu: I think there is also a release_40 branch in their repo
16:04 armyriad joined
16:04 <bollu> cocreature: cool, thanks :)
16:05 <cocreature> bollu: btw what kind of work are you doing that requires nightly llvm?
16:06 Rainb joined
16:06 <bollu> cocreature: I work on Polly
16:06 <bollu> cocreature: I recently started :)
16:06 <cocreature> oh cool
16:06 mda1 joined
16:08 urodna joined
16:09 zariuq joined
16:11 xtreak joined
16:11 Sonolin joined
16:13 meba joined
16:14 Rainb joined
16:14 refold joined
16:14 oisdk joined
16:14 doomlord joined
16:15 m1dnight_ joined
16:15 xall joined
16:16 conal joined
16:16 yogsotot_ joined
16:18 bgamari joined
16:18 Rainb joined
16:18 rigel_ joined
16:19 rigel_ left
16:19 Jacoby6000 joined
16:21 ozgura joined
16:23 xinming joined
16:24 raycoll joined
16:24 kus_ubuntui686 joined
16:24 kus_ubuntui686 joined
16:24 bob_ joined
16:25 xtreak joined
16:27 ragepandemic joined
16:30 splanch joined
16:30 oish joined
16:30 tromp joined
16:30 ystael joined
16:31 hurkan left
16:32 <tobiasBora> Hello,
16:32 <tobiasBora> I've two questions:
16:32 <tobiasBora> 1) Between Parser and Regexp, which one is the fastest (or what are the advantages of one over the other)
16:33 dbmikus_ joined
16:33 <tobiasBora> 2) I'm trying to use Parsec to find an email in a text, but I'm having some difficulties
16:34 <tobiasBora> For example
16:34 <tobiasBora> how could I concatenate two Parser String ?
16:34 <tobiasBora> for now I write something like:
16:35 cmsmcq joined
16:36 Mickael joined
16:36 <tobiasBora> parseEmailOnly = do {localPart `manyTill` string "@"; many domainPart}
16:36 zargoertzel joined
16:36 <tobiasBora> with:
16:36 <tobiasBora> localPart = satisfy (\c -> isAlphaNum c || c `elem` ".!#$%&'*+-/=?^_`{|}~")
16:36 <tobiasBora> domainPart = satisfy (\c -> isAlphaNum c || c `elem` ".-")
16:36 <tobiasBora> The thing is that when I do:
16:36 <tobiasBora> email <- parseEmailOnly
16:37 <cocreature> tobiasBora: you can parse more languages with Parser than you can parse with regex. if regex are sufficient for your application, then I would expect them to be faster but that depends on the exact implementations you’re using
16:37 <tobiasBora> I just have the last part "gmail.com"
16:37 <Geekingfrog> tobiasBora: because in your parseEmailOnly, only the last parser will be used for the result
16:37 <tobiasBora> Geekingfrog: Yes, I understand why, but I don't see how "concatenate" the parser
16:38 <Geekingfrog> tobiasBora: a correct version would be: parseEmailOnly = do {local <- localPart; domain <- domainPart; pure (local ++ domain)}
16:38 <Geekingfrog> This way you're not discarding the result of the first parser
16:39 peterbec` joined
16:39 WarmCookie left
16:40 MitchellSalad joined
16:40 kau joined
16:40 <tobiasBora> Geekingfrog: I though to this solution but I though it was dirty... Because if I've to many lines, it becomes something like (a ++ b ++ c ++ d ++ e)... Well maybe I could use list concat & monad do deal with that...
16:41 KarboniteKream joined
16:42 _sras_ joined
16:42 <_sras_> How does generics work in Haskell, or what actually happens when I add `deriving (Generic)` at the end of a data type def?
16:42 coolix joined
16:42 <Squarism> +1
16:42 <Geekingfrog> tobiasBora: I usually go first for something which works, and then refine it. concat [a, b, c, d, e] would be a first step indeed.
16:43 <tobiasBora> Geekingfrog: Yes sure
16:43 <lyxia> _sras_: an instance of Generic is derived, and you can look at it using the -ddump-deriv option
16:44 t0by joined
16:44 t0by joined
16:44 <tobiasBora> Well, now that we have a working version parseEmailOnly
16:44 Rodya_ joined
16:44 zariuq joined
16:44 <tobiasBora> I have problems to look for that in the whole text, because many1 seems to be greedy:
16:45 <tobiasBora> For now I've something like:
16:45 <tobiasBora> many anyChar
16:45 <tobiasBora> email <- parseEmailOnly
16:45 <tobiasBora> many anyChar
16:45 <tobiasBora> eof
16:45 <tobiasBora> return email
16:45 <tobiasBora> (forgot the bad indentation)
16:45 <Geekingfrog> yeah, many anyChar will eat everything
16:46 <tobiasBora> Geekingfrog: Yeah that's the problem. I tought to use something like try, but not sure it's the good way to proceed.
16:46 Edith joined
16:46 augur joined
16:46 <cocreature> _sras_: basically Generic is just a way to convert a type from & to a representation made up of the types listed at the top of GHC.Generics
16:46 marr joined
16:46 <erisco> hrm
16:46 <erisco> are bounded arrays not possible with SBV?
16:47 dawehner joined
16:47 <cocreature> erisco: I don’t know about sbv but SMT does not support them so that seems likely
16:47 sellout-1 joined
16:47 <robkennedy> Is there a way to force fromString to fire at compile time?
16:47 <erisco> I see, strange
16:47 chenshen joined
16:47 <cocreature> erisco: usually you work around this by constraining your indices to a fixed range
16:47 eklavya joined
16:48 <erisco> yes that is an option I can use
16:48 MitchellSalad joined
16:49 <cocreature> erisco: I guess if your length is a power of two you could also constraint your index type
16:49 carlosda1 joined
16:49 <cocreature> erisco: the thing is SMT arrays are really just total functions with the index sort being the domain
16:50 MitchellSalad joined
16:50 ozgura_ joined
16:51 <tobiasBora> Geekingfrog: I found this solution that seems to work
16:51 <tobiasBora> http://stackoverflow.com/questions/29549435/parsec-how-to-find-matches-within-a-string
16:52 zerokarmaleft joined
16:52 Mickael joined
16:52 Rodenbach joined
16:53 <_sras_> cocreature: Is it feasible to write a generic instance for a type, manually?
16:53 <Geekingfrog> tobiasBora: that's neat.
16:54 <tobiasBora> Geekingfrog: I'll try to do some benchmark to see how fast it is compared with regexp. But anyway, thank you for your help!
16:54 nighty- joined
16:55 <cocreature> _sras_: yes the haddock show how to do that
16:55 <cocreature> _sras_: but I don’t know of any reason why you would want to do this
16:55 <erisco> cocreature, little confused as to why something like mkSymArray isn't in the lib
16:55 <erisco> http://lpaste.net/354067
16:55 RegEchse joined
16:55 <erisco> the offered API is a bit strange... really bare bones
16:56 jathan joined
16:56 <erisco> whereas other facilities are more high level
16:56 Apocalisp joined
16:56 <Geekingfrog> tobiasBora: you can probably have a more aggressive version than the one in the SO answer, where if the email parser fails, you can skip the whole word (manyTill spaceChar)
16:56 <_sras_> cocreature: Need to derive generic instance for a record in which one of the field is a type from an external lib.
16:57 danthemy_ joined
16:57 augur joined
16:57 t7 joined
16:58 <cocreature> _sras_: use standalon deriving
16:59 <erisco> mkSymArray @SArray @Word8 [10,20,30] seems kind of obvious *shrug*
16:59 <lyxia> _sras_: The derived Generic representation should work with any type of field
16:59 danthemy_ joined
17:01 Luke joined
17:01 doomlord joined
17:01 MitchellSalad joined
17:03 boombanana joined
17:03 Ferdirand joined
17:03 niHiggim joined
17:04 oberstein joined
17:05 leshow joined
17:06 obadz joined
17:10 <erisco> cocreature, this will do splendidly... it doesn't support existential arrays but it does support existential indices
17:10 dpren joined
17:10 <erisco> and I can figure out how to encode my problem that way... at least now I can
17:11 <erisco> spent a lot of hours chasing another approach that got too complicated
17:11 psniper joined
17:11 cpup joined
17:12 <erisco> I need to know which propositions satisfy a particular hole
17:12 <erisco> thankfully I have a finite list of candidates
17:14 detrumi joined
17:15 verement joined
17:15 dawehner joined
17:16 <reactormonk> cocreature, _ is pretty helpful, thanks!
17:16 <cocreature> reactormonk: yep it’s great! I use it all the time
17:17 <Myrl-saki> lyxia: Sorry late reply. I don't understand what he means by "cannot be defined as a term in these systems."
17:19 animated joined
17:20 tempname11 joined
17:20 <lyxia> Myrl-saki: You can't write a well-typed lambda term with the type of fix in system F (Girard/Reynold's system).
17:20 <shapr> Sometimes I wish I could use type holes in verbal discussions.
17:20 Rodya_ joined
17:20 tempname11 left
17:20 <byorgey> shapr: verbal discussions about types? Or do you mean more metaphorically? =)
17:20 <shapr> more metaphorically
17:21 <shapr> Mostly when discussing requirements
17:21 tempname11 joined
17:21 <shapr> Something like "I need you to fill in this hole with your own information"
17:21 <byorgey> I mean, English kind of *does* have type holes. They are called "pronouns". =)
17:22 <byorgey> I see what you mean though.
17:22 <shapr> I think lojban has explicit type holes, with mo and ma
17:22 KarboniteKream joined
17:23 <shapr> byorgey: hm, that's a good point
17:23 <Myrl-saki> lyxia: I guess that means Haskell isn't System F, what is it then?
17:23 newbie joined
17:24 <shapr> I always think of type holes as a way of asking GHC questions about my code.
17:24 Berra joined
17:24 <shapr> So lojban's mo and ma are closest how I use type holes.
17:24 <lyxia> Myrl-saki: You can probably get pretty close with system F + fix + data types.
17:24 zariuq joined
17:25 <lyxia> It's probably best to think of Haskell as Haskell though.
17:25 b4ff3r joined
17:25 <dolio> F doesn't even have all the higher kinds.
17:25 <dolio> Just *.
17:25 <byorgey> it's like System F omega + fix + data types + type equality constraints. or something.
17:25 <dolio> But Haskell doesn't have all the higher ranks of F without extensions.
17:26 <byorgey> ah, true
17:26 zargoertzel joined
17:26 connrs joined
17:27 oberstein joined
17:28 MoALTz joined
17:28 <dolio> If you have all the ranks, you don't exactly need to add data types, either, because they can be encoded.
17:29 <dolio> Depending on whether you consider encodings good enough.
17:29 <dolio> Or, I guess having all the ranks doesn't matter. But you have to be impredicative like F and F omega are usually specified to be.
17:30 <dolio> They're both important.
17:31 certainty joined
17:32 sleffy joined
17:32 earldouglas joined
17:34 <danza> sorry ... the Hackage upload form uses HTTP for username and password?
17:35 yellowj joined
17:36 Big_G joined
17:36 <byorgey> I thought it uses HTTPS?
17:37 <glguy> Yeah, you should use HTTPS when connecting to it to upload, but you don't have to.
17:38 <danza> oh, i see ... thanks +1
17:39 BlueRavenGT joined
17:39 bt12 joined
17:41 serses joined
17:41 Fendor joined
17:41 <danza> this is also interesting https://github.com/haskell/hackage-server/blob/master/Distribution/Server/Packages/Unpack.hs#L313 ... how are these names decided? And how can i find the top level node my logic belongs to?
17:42 splanch joined
17:43 markus1189 joined
17:43 <serses> describeLoser user = if user == 'Haskell user' then 'loser' else then 'Not loser'
17:43 markus1199 joined
17:44 <mauke> that's a syntax error
17:44 coltfred joined
17:44 <serses> only a loser would know
17:45 <mauke> or a compiler
17:45 <mauke> there's also a grammar error and a naming error
17:46 sirius[m] joined
17:47 objxbwgen joined
17:49 KarboniteKream joined
17:49 phyrex1an joined
17:51 dfeuer joined
17:51 <danza> regarding my question above, i found a nice reference https://wiki.haskell.org/Hierarchical_module_names
17:52 skeuomorf joined
17:52 xtreak joined
17:52 oberstein joined
17:52 <reactormonk> The eff paper mentions "the (abstract) type Union (r :: [* -> *]) x where the first argument r is a type-level list of effect labels" - how do I write that in haskell?
17:53 <reactormonk> that, as in the type Union
17:53 <Gurkenglas_> Dont forget the semantic error!
17:55 <sophiag> i couldn't find a library that provides a data type for storing lambdas (for similar purposes to quote in lisps) so figure i'll write one myself. given that, i'm wondering how to represent operators in an adt?
17:55 marvin2 joined
17:55 chenshen joined
17:55 <sophiag> i figured i could do something like (Symbol "+"), but that doesn't seem to be correct
17:55 <byorgey> sophiag: what do you mean "storing lambdas"? What do you want to do with the stored lambdas?
17:56 <Sonolin> sophiag do you mean like the Endo type?
17:56 <sophiag> byorgey: as mentioned, similar to quoting them in lisps
17:57 <byorgey> sophiag: can you be more specific? For what purpose would you quote lambdas in lisps?
17:57 augur joined
17:57 <sophiag> so you can store them as data and then unquote them to apply
17:57 <reactormonk> sophiag, you could store the underlying system-F, but then you'd need a ghc along to compile it once you load it again
17:57 <byorgey> sophiag: Haskell has first-class functions, so you can just store functions in a data type. You don't need to quote them.
17:58 <sophiag> reactormonk: i'm doing this basically to avoid having to do that
17:58 chlong joined
17:58 <byorgey> > :type [\x -> x + 1, \x -> x*3 + 19, \x -> 2] :: [Int -> Int] -- a list of functions
17:58 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
17:58 <reactormonk> sophiag, you'll need some runtime anyway, unless you wanna go implement your own language with Free or similar
17:58 <byorgey> @type [\x -> x + 1, \x -> x*3 + 19, \x -> 2] :: [Int -> Int] -- a list of functions
17:58 <lambdabot> [Int -> Int]
17:59 replay joined
18:00 <sophiag> oh, so i can just define a list of functions by using their type signature?
18:00 <byorgey> > let myFuns = [\x -> x + 1, \x -> x*3 + 19, \x -> 2] in map (\f -> f 3) myFuns -- apply all the functions to the input 3
18:00 mizu_no_oto_work joined
18:00 <lambdabot> [4,28,2]
18:00 <byorgey> you don't even need a type signature, I just included that for illustrative purposes
18:00 <byorgey> but using the type signature is probably a good idea.
18:00 carlosda1 joined
18:01 <sophiag> uh...well otherwise i have no way to define the list
18:02 <byorgey> I'm not sure what you mean. That's not true. See my example above where I made a list of functions and then applied them all to 3. There are no type signatures.
18:02 <sophiag> data Lambdas = [it's cool don't need anything here]
18:02 <sophiag> ^ i imagine that wouldn't work
18:03 <byorgey> sophiag: perhaps you mean by using their definitions? The things that go in the brackets are not type signatures.
18:03 <Sonolin> yea type signatures in haskell are mostly optional, and let you specify a specific type
18:03 serses left
18:03 <byorgey> a type signature would be something like Int -> Int. What goes in the brackets is something like \x -> x + 2
18:03 deepfire joined
18:03 <sophiag> so i can have a list of functions with different type signatures?
18:03 <lyxia> reactormonk: you can write it as a data family.
18:03 <byorgey> sophiag: no, all the elements of a list must be the same type.
18:04 osa1 joined
18:04 osa1 joined
18:04 <byorgey> now you are going to tell me that you want to have a list of functions with different type signatures. And I am going to ask you what on earth you would do with such a list if you had it.
18:04 <sophiag> no i didn't say that
18:04 <byorgey> ok good =)
18:04 <Sonolin> sophiag: you can get away with it sometimes using clever "forall", but really you're just limiting what you can do with the resulting functions
18:04 <byorgey> I have to go teach a class, but hopefully others can continue to help
18:05 <sophiag> YOU said i can define a type of lambdas without specifying their type signature
18:05 <sophiag> how would i do that?
18:05 <sophiag> data Lambdas = Lambdas [what goes here]
18:05 <Sonolin> well you would have to put a type definition there
18:06 <Sonolin> I think he means dynamically declaring lists of functions do *not* need type signatures
18:06 <sophiag> Sonolin: you just said it wasn't necessary (twice)
18:06 <Myrl-saki> lyxia: Ah. Thanks.
18:06 xtreak joined
18:09 <Sonolin> a type isn't optional when you declare a variable, but it is required when you declare a type (to my knowledge at least)
18:09 <Sonolin> *is optional when you declare a variable
18:09 _sras_ joined
18:09 <Sonolin> you could do something like this though
18:09 <Sonolin> data Lambdas a = Lambdas [a -> a]
18:10 <sophiag> hmm ok. i was fine specifying the type
18:10 <sophiag> just asking you to clarify why you repeatedly said that wasn't necessary
18:10 albertus1 joined
18:10 <monochrom> I think you are confusing "define a user-defined type" with "give a type annotation".
18:11 <Sonolin> sorry, I misunderstood - didn't see the part about you specifically declaring a datatype
18:13 CurryWurst joined
18:14 <sophiag> Sonolin: it's cool. i liked your idea to use a type variable.
18:14 carlosda1 joined
18:14 <sophiag> i'm wondering how to use datatypes with arguments in records though?
18:14 xanadu_ joined
18:15 yogsotot_ joined
18:15 <sophiag> like if i have "Lambda a = Lambda [a -> Bool]" how to do define the variable in a record?
18:15 psniper joined
18:16 <monochrom> I don't understand the question. What record do you have in mind?
18:16 <sophiag> something like "Foo = Foo { tag :: Maybe String, lambda :: Lambda * }"
18:17 <monochrom> OK, data Foo = Foo { tag :: Maybe String, lambda :: Lambda Int }. If you want Int there.
18:17 <_sras_> I am trying to use StandaloneDeriving to derive a FromJson instance for a type that is coming from an external lib. Assuming that the 'Email' type is coming from an external lib, how can I make this work?
18:17 <_sras_> http://lpaste.net/354074
18:17 <sophiag> monochrom: i can't continue to use a variable?
18:17 <Sonolin> yea you can also use another type variable in the Foo declaration
18:18 <Sonolin> so data Foo a = Foo { lambda :: Lambda a }
18:18 <monochrom> Yeah.
18:18 <sophiag> ah ok
18:19 <sophiag> although i guess then that becomes an issue if i want to have lists of the record where a are different?
18:19 <monochrom> Yes.
18:19 <sophiag> yeah, that's what i was trying to avoid...
18:20 <monochrom> In fact as byorgey said, the issue is not with how to make it possible.
18:20 <monochrom> The issue is with, if you gave me such a list, how could I possibly use it.
18:21 <sophiag> i have that figured out
18:21 raynold joined
18:21 <monochrom> OK, how do I use it? For starters, how do I determine the type of the first item?
18:21 <sophiag> the first item?
18:21 <monochrom> Of the list you gave me.
18:22 <sophiag> the first item is a Maybe String
18:22 <monochrom> Always?
18:22 chlong joined
18:23 <monochrom> I am not talking about Foo, you know. I am talking about, let's say, [Foo].
18:23 <sophiag> if present it will match with a field in another record and then the type of the bound variable of the lambda will match the lists in that record. if not present then everything will be of the same type, as specified by the lists in the other record
18:23 handyc joined
18:24 <lyxia> _sras_: use standalone deriving to derive Generic for Email
18:24 <monochrom> OK I don't understand any of it.
18:24 <lyxia> _sras_: and then just write instance FromJSON Email
18:24 <sophiag> monochrom: regardless you said it's not an issue to have a record where i encapsulate the type variable in one field...how do i do that?
18:24 <lyxia> _sras_: assuming the generically derived instance is what you actually want.
18:25 jgertm joined
18:25 <monochrom> OK, look up "existential quantification" in the GHC user's guide.
18:25 <sophiag> ah, gotcha. thank you
18:26 <sophiag> i always wondered what the use case for that was
18:26 Luke joined
18:27 azahi joined
18:28 <_sras_> lyxia: Works. Thanks!
18:28 <monochrom> And you need to see my http://lpaste.net/165712#a165719 . It shows you why I keep saying the issue is with what can a consumer do.
18:28 anRch joined
18:29 <monochrom> And you need to see this joke:
18:29 mohsen_ joined
18:30 <monochrom> @quote monochrom river
18:30 <lambdabot> monochrom says: You are to send a boolean, a character, and an integer across the river. The list for transporting across the river can hold 3 items, in fact any number of items you like, but they
18:30 <lambdabot> must all be of the same type. On the bright side, after crossing the river, the boolean, the character, and the integer need only be put on show. How many trips do you need? Solution: one trip, [
18:30 <lambdabot> show the_boolean, show the_character, show the_integer]
18:33 MindlessDrone joined
18:34 oberstein joined
18:34 <sophiag> monochrom: as mentioned, they'll be implicitly the same because i'm naming what i'll end up applying it to with the records
18:35 arctictern joined
18:35 unK_ joined
18:36 <sophiag> the one thing i'm left wondering is how to define an instance of Show for my lambda type
18:36 <hexagoxel> are there cases where replacing "do" with "mdo" makes a syntactically valid program invalid?
18:37 <monochrom> I think no. But it can change semantics.
18:37 <centril> is there a paper somewhere on the computational forms of normalization (Eq a => a -> a, a -> Maybe a, a -> (Any, a), ... ) ?
18:37 marsam joined
18:37 Glooomy joined
18:37 <monochrom> Wait, I actually don't know for sure.
18:37 <centril> are there more forms (obvious or not) I should include ?
18:37 tomboy64 joined
18:38 <lyxia> centril: what is that
18:38 Glooomy joined
18:38 Swizec joined
18:38 <centril> lyxia: the types (i can think of) for reduction steps / normalizations
18:38 <monochrom> Ah, yes, here it is: do { x <- aaa; x <- bbb x; ... }. The semantics is shadowing. Change do to mdo, and you get mfix semantics.
18:39 <centril> on a term of type a
18:39 Glooomy joined
18:39 zaquest joined
18:39 Glooomy joined
18:40 <hexagoxel> monochrom: right, thanks.
18:40 Glooomy joined
18:41 <monochrom> centril: What is (Any, a) doing there?
18:41 pera_ joined
18:41 xanadu_ joined
18:41 <centril> monochrom: determines if normalization has happened or not, if True, then yes, if False, then no
18:42 <monochrom> True and False are Bool's, not Any's or a's.
18:42 <centril> :t Any
18:42 <lambdabot> Bool -> Any
18:42 henriksod joined
18:43 <centril> monochrom: Any is just Bool + (||) as the binary operator
18:43 <centril> with False as identity
18:44 <monochrom> OK. (Any, a) is equivalent to Either a a, so you will have it on your list too.
18:44 albertus1 joined
18:45 <centril> monochrom: yes, but Either a a is awkward as a monad - you want "did normalization occur anywhere", not: "did normalization occur everywhere?"
18:45 aarvar joined
18:45 <centril> (I want)
18:45 <monochrom> I don't think when I said "Either a a" I had "everywhere" in mind.
18:46 <centril> monochrom: right, but isnt it similar enough to a -> Maybe a ?
18:47 ExpHP joined
18:47 <monochrom> All members of the list are similar enough to a -> Maybe a.
18:47 <centril> true
18:48 <centril> monochrom: is there some radically different alternative?
18:48 MitchellSalad joined
18:48 <centril> I've perhaps overlooked... ?
18:48 tempname11 joined
18:48 <monochrom> I don't know about radical. But I know how to double the list length by simply doing church-encoding.
18:48 simendsjo joined
18:48 coot joined
18:49 <monochrom> For example, since a -> Maybe a is on the list, therefore forall r. a -> r -> (a -> r) -> r is also on the list.
18:49 dzdcnfzd joined
18:50 chlong joined
18:50 <dzdcnfzd> Hey guys! I'm trying to install servant-server, getting the following error: Rule "FromJSONKeyCoerce: fmap id" may never fire because ‘id’ might inline first
18:51 <monochrom> Böhm-Berarducci encoding, actually, as Oleg said. But more people call it Church.
18:51 <centril> monochrom: right - but there isnt some very common obvious thing that should be on the list that i've missed?
18:51 <dzdcnfzd> http://lpaste.net/354076
18:51 <dzdcnfzd> Any advice?
18:51 <monochrom> If you allowed non-determinism. But I guess you don't.
18:51 peterbec` joined
18:52 <monochrom> My experience is that a -> (Any, a) leads to the least ugly code.
18:52 inad922 joined
18:52 <centril> monochrom: yeah, it was really nice to work with - it feels natural as a monad
18:52 IRCFrEAK joined
18:53 preyalone joined
18:53 <centril> and it's probably (no evidence for this...) a performant form as well - better than Eq a => a -> a at least
18:54 <monochrom> Actually my experience has only been with a -> Maybe a and it led to ugly code, and I understand why it's ugly, and a -> (Any, a) eliminates that reason.
18:54 carlosda1 joined
18:54 alx741 joined
18:55 <centril> monochrom: yeah, we tried a -> Maybe a at first, it was horribly littered with manual checks for "did it change?"
18:55 IRCFrEAK left
18:55 <centril> then we went over to a -> (Any, a) and made all troubles go away
18:55 <monochrom> The reason is that in the Nothing case, often I still want the original expression. So now my code has to refer to the input expression all the time. Not very linear dataflow.
18:55 Guest64723 joined
18:55 Guest64723 left
18:55 <centril> yeah
18:57 <MitchellSalad>
18:57 <centril> monochrom: also, with a a -> m (Any, a) you get a nice a -> WriterT Any m a interface
18:57 <monochrom> In retrospect, the Maybe monad says that Nothing stands for "abort mission! abort mission!" so it is totally the opposite of "no news is good news".
18:57 <centril> monochrom: right :P
18:57 <centril> good analogy
18:57 <centril> monochrom: I might even steal it as a quote
18:58 <centril> (unfortunately it doesn't fit very well into a bachelors thesis paper ^^)
19:00 psniper joined
19:01 connrs joined
19:01 niteria joined
19:01 <monochrom> Well, you can say the same idea in more serious wording and discussion. The main idea is that the semantics of a data type is not just in its possible values, the semantics is in the operations, what >>= will do.
19:02 <centril> monochrom: that's the idea =)
19:03 benjamin2 joined
19:03 <monochrom> OTOH no reason why some humour can't go into a thesis.
19:03 <centril> monochrom: tho, "serious" might not as aptly convey the message as your two "quotes"
19:04 <centril> monochrom: yeah - is it OK if I use those in some form ?
19:04 <monochrom> YES!
19:04 <centril> yay
19:05 <centril> off I go then, time for some cake
19:05 electrostat joined
19:05 <lpaste_> ExpHP pasted “dumb join” at http://lpaste.net/354077
19:05 <ExpHP> ^ is there a way around this join?
19:06 <monochrom> Yes, use >>= :)
19:06 <ExpHP> Hm, I tried that but I think ran into precedence issues
19:06 <monochrom> Use do-notation.
19:06 <ExpHP> booo
19:07 IRCFrEAK joined
19:09 mattyw joined
19:09 <monochrom> You cannot stay within Applicative to get this done. I think at the very least you need Arrow. But Monad is much more lightweight than Arrow.
19:10 IRCFrEAK left
19:11 uglyfigurine joined
19:11 coot joined
19:11 infandum joined
19:12 <infandum> If text is "A space efficient, packed, unboxed Unicode text type," why can't I derive an instance of Unboxed Text?
19:12 m1dnight_ joined
19:13 <infandum> sorry, Unbox Text
19:13 <monochrom> The sentence only means that individual codepoints are unboxed. Not that the whole thing is unboxed.
19:14 <monochrom> Where can I read about Unbox?
19:14 <infandum> ah
19:14 <lyxia> Is that vector's Unbox
19:16 <infandum> I assumed so, but now I don't know
19:16 <monochrom> No, actually not individual codepoints either. It uses UTF-16, and individual 16-bit words are unboxed.
19:16 <cocreature> infandum: what do you need that instance for?
19:16 <monochrom> Anyway, the problem with reasoning by natural language keywords.
19:17 KarboniteKream joined
19:18 <infandum> cocreature: I have a: "newtype ID = ID Text deriving (Unbox)", because I'll have a vector of IDs and I want it to be fast. Then I get the error where Unbox Text cannot be derived.
19:18 ij joined
19:18 <monochrom> But "deriving" is only for a few selected classes, such as Eq.
19:19 <infandum> I got it from this: http://stackoverflow.com/questions/39275603/automatically-derive-unbox-for-newtype-without-th
19:19 rcat_ joined
19:19 <infandum> I guess it's a new feature
19:19 <cocreature> infandum: unboxing Text will buy you very little because the actual text storage doesn’t have a fixed length so it can’t be unboxed.
19:19 <cocreature> infandum: so at best you’ll unbox the length of the Text in your vector
19:19 <ij> I remember seeing an f such that: "Just x `f` Just y = Just x" (or Just y) and Nothing on either side is the identity.
19:20 <infandum> cocreature: But the point is that downstream I don't want to keep converting from Boxed to Unboxed and back and forth.
19:20 <monochrom> That's going to be Alternative's <|>
19:20 <cocreature> infandum: just use normal Text everywhere?
19:21 <infandum> cocreature: Sorry? What do you mean?
19:21 <cocreature> infandum: unboxing is only likely to make a difference if you can unbox the value completely into your vector
19:21 <cocreature> infandum: otherwise you’re better off just using normal boxed vectors
19:21 <infandum> cocreature: But what about converting back and forth? I want unboxed elsewhere as it has significant speed boosts, and converting must take some time...
19:21 psychicist__ joined
19:22 <cocreature> infandum: it doesn’t have a significant speed boost for text, at least I doubt it has in any real application
19:22 pera joined
19:22 <infandum> like, fmap (Text -> Int) (Boxed.Vector Text)
19:22 <ij> monochrom, Thanks!
19:22 <infandum> then I have a boxed vector of ints but I want unboxed for later so I would need to convert
19:23 <infandum> for instance
19:23 <monochrom> Text -> Int is already pretty non-trivial. You already have a conversion.
19:23 ptvirgo joined
19:23 <cocreature> infandum: unboxing Text is unlikely to make a difference because the Text data _can’t_ be unboxed
19:23 mizu_no_oto_work joined
19:23 <monochrom> And fmap (Text -> Int) (Boxed.Vector Text) is merely transforming a compact array of pointers to a compact array of numbers.
19:23 <infandum> I'm very confused now. I'm just saying that I would like unboxed everywhere because there are some functions that work much faster on unboxed.
19:24 <cocreature> infandum: I’m just saying that they don’t work much faster in the case of Text :)
19:24 <cocreature> unboxing is not some magic hammer that makes your code faster
19:24 strelok7 joined
19:24 GOLDPANK joined
19:25 <cocreature> infandum: also I’m not even sure what you mean by unboxing Text outside of a vector
19:25 <infandum> cocreature: That's understandable, but the only reason I want an unbox instance for text isn't because of text, it's because there are other downstream elements that are unbox instances and are faster.
19:25 <monochrom> Oh, I see, fmap preserves array flavour
19:25 mattyw joined
19:25 <monochrom> perhaps don't use fmap, use generate or something
19:25 <cocreature> infandum: ah now I understand your point.
19:27 <monochrom> In fact, it is very possible that fromList . fmap f . toList is the fastest.
19:27 GOLDPANK left
19:29 <cocreature> infandum: the stackoverflow post you linked to only talks about deriving an Unbox instance for a _newtype_ of something that _already is_ an instance of Unbox. you can’t derive that instance in general
19:29 <infandum> cocreature: Exactly, Text isn't unboxed.
19:29 <cocreature> infandum: you should be able to write an instance
19:30 <infandum> That might be a little too complicated.
19:30 <cocreature> I doubt that
19:30 <cocreature> the docs contain an example
19:31 <infandum> cocreature: I made one for Maybe and for an ADT I have
19:31 <infandum> I'm not familiar with the inner workings of text though
19:32 <infandum> monochrom: Not convert . fmap f?
19:32 <cocreature> but I also doubt that you will gain any performance by using an Unboxed vector of text. just change to that once it actually makes a difference.
19:32 <cocreature> infandum: you don’t need to be familiar with how it works. you just need to know that it’s isomorphic to (Array, Int, Int) and reuse the instance for that
19:32 <infandum> cocreature: I just assumed that keeping one vector type throughout the program would be best
19:32 <monochrom> Oh! convert exists. Yeah, possibly even better.
19:33 <cocreature> infandum: vectors are immutable so mapping over it creates a new vector anyway
19:33 <monochrom> No, possibly worse.
19:33 <infandum> hmmm
19:33 <monochrom> Err, no, I don't know that. They may have enough fusion laws.
19:34 <infandum> Okay, so basically whenever I have Prims I should use Unbox and Box for the rest, even when it's acting "on the same array"?
19:34 <cocreature> fusion laws don’t help. unboxed vectors don’t have the same space so you can’t reuse them
19:34 <monochrom> In all fairness my fromList . map f . toList assumes more fusion laws than convert . fmap f
19:34 <infandum> that might be a lot of converting
19:34 arctictern joined
19:35 Nicnux joined
19:35 <glguy> fusion is about not recreating intermediate vectors, not reusing them
19:35 <monochrom> No no, cocreature, it's OK, my fromList . map f . toList relies only on eliminating the intermediate list, and convert . fmap f relies only on eliminating the intermediate boxed-array.
19:35 strelok7 joined
19:36 <monochrom> We have pretty much accepted that a brand new array is to be created and filled. We are just making sure that nothing else is.
19:36 <monochrom> Or hoping.
19:37 Luke joined
19:37 <infandum> Maybe I should use lists
19:37 <infandum> haha
19:38 <cocreature> infandum: basically all I’m trying to say is: benchmark before you decide that unboxing Text will help :)
19:38 <Jinxit> if i have a (Foo (Bar a)) where both Foo and Bar are applicative, how do i use <*>, <* and *> on Bar?
19:38 <monochrom> Do not forget that fmap f . convert is also an option. :)
19:38 <monochrom> Err wait, nevermind, not an option.
19:38 <cocreature> infandum: if you have trouble writing the instance, I’m happy to help. you can literally reuse most of the example in the haddocks
19:39 <Jinxit> sorry, let me rephrase, I have multiple Foo (Bar a)) but i want to work on the -inner- type with <*>
19:39 <cocreature> Jinxit: fmap operationOnInnerType
19:39 <infandum> monochrom: Why is it not an option?
19:40 _I_R_C_F_R_E_A_K joined
19:41 <cocreature> monochrom: unboxed vectors are not an instance of Functor
19:41 <APic> 😎
19:41 <monochrom> Because I will type annotate it to show it is: unboxed array of number <--- fmap f <--- unboxed array of text <--- convert boxed array of text
19:41 <infandum> cocreature: Interesting... I didn't even realize that
19:42 <infandum> cocreature: Wait, why? Shouldn't that be an easy instance to make?
19:42 <monochrom> Jinxit: You will need both <*> for the Foo level and the <*> for the Bar level.
19:42 <infandum> It's a vector. What makes boxed a functor but not unboxed?
19:43 MP2E joined
19:43 <monochrom> Because you are looking at Boxed a => BoxedVector a
19:43 <cocreature> infandum: it’s impossible to make that instance because there is not a polymorphic unboxed vector type. vector uses data families to make it look like it is but that’s not the case
19:43 <monochrom> err
19:43 <monochrom> Because you are looking at Unboxed a => UnboxedVector a
19:43 <Myrl-saki> https://people.mpi-sws.org/~dreyer/tor/papers/wadler.pdf 3.1, how did he go from relations back to types?
19:43 <Jinxit> i don't see how to do it with two values, for example Just (Just (+5)) <*> Just (Just 2)
19:44 <Jinxit> (except not <*> of course)
19:44 Ferdirand joined
19:44 <infandum> ah oops
19:44 <monochrom> Err nevermind, what cocreature said.
19:44 dawehner joined
19:45 <monochrom> > (<*>) <$> Just (Just (+5)) <*> Just (Just 2)
19:45 <lambdabot> Just (Just 7)
19:45 mkoenig joined
19:45 <Jinxit> ohh right
19:45 <infandum> cocreature: I don't want to be stupid, but couldn't you just do fmap f v = fromList . fmap f . toList?
19:45 <Jinxit> i was overthinking it, thanks
19:45 <infandum> fmap f = that is
19:45 <monochrom> The 1st <*> is for the inner level. The 2nd <*> is for the outer level. The <$> is also the outer level
19:45 <infandum> it isn't ideal, but this is conceptual, not performance
19:46 <cocreature> infandum: you literally can’t even write an empty Functor instance
19:46 <infandum> yup
19:46 <infandum> ok
19:46 <infandum> got it
19:46 <cocreature> infandum: and even if you could, that would fail because calling "fromList" would require an Unbox instance on b which you might not have
19:46 <cocreature> which is what monochrom was trying to explain
19:47 <infandum> i see
19:47 <cocreature> which is similar to why Set has no Functor instance
19:47 <infandum> and I guess there are no restrictions for fmap (a -> b)
19:47 <Jinxit> monochrom: is there a simple way to do this for N arguments?
19:47 <infandum> makes sense, had a brain moment
19:47 <cocreature> brain moments are always good :)
19:48 <cocreature> infandum: also I’m sorry if I sounded a bit grumpy before, that was not my intention
19:49 <Jinxit> for the first <*> i mean
19:49 <infandum> cocreature: No, not at all, you were very helpful.
19:50 psychicist__ joined
19:50 <infandum> cocreature: Also, that's why map exists for unboxed (and has the constraints)
19:50 <cocreature> infandum: exactly!
19:50 _I_R_C_F_R_E_A_K left
19:51 <monochrom> I think it's like this: (\a b c -> a <*> b <*> c) <$> Just (Just (-)) <*> Just (Just 4) <*> Just (Just 3)
19:51 <monochrom> > (\a b c -> a <*> b <*> c) <$> Just (Just (-)) <*> Just (Just 4) <*> Just (Just 3)
19:51 <lambdabot> Just (Just 1)
19:52 <monochrom> Equivalently, liftA3 (\a b c -> a <*> b <*> c) (Just (Just (-))) (Just (Just 4)) (Just (Just 3))
19:52 cdg joined
19:52 bjz joined
19:53 bennofs joined
19:53 peterbec` joined
19:53 sssilver joined
19:53 Rodya_ joined
19:53 <monochrom> Ironically, "lift" is only from the type perspective. From the value perspective it's "descend".
19:54 splanch joined
19:54 <monochrom> Although, "inner" and "outer" are also from the type perspective only.
19:55 arctictern joined
19:55 arctictern joined
19:56 arctictern joined
19:56 <monochrom> Err, I guess not, "[Just 4]" the Maybe type and the Just value are both inner.
19:57 arctictern joined
19:58 arctictern joined
19:59 <ph88> can anyone help me understand this http error? https://bpaste.net/show/2b7a5cfb1d15
19:59 Itkovian joined
19:59 <ph88> oh shit, i think this is one of those moments where i see the error as i make the paste -___-
19:59 <ph88> (watch port)
19:59 coltfred joined
19:59 <cocreature> localhost:9998 is probably not a valid host :)
20:00 dylukes joined
20:00 <monochrom> That too.
20:01 <ph88> it's a valid host for sure " Welcome to the Apache Tika 1.14 Server "
20:02 azahi joined
20:02 <ph88> it works, beautiful, beautiful
20:02 <monochrom> I be damned if DNS suddenly understands "xxx.com:80"
20:03 Frankablu joined
20:04 <monochrom> Every DNS software keeps expanding until it contains a web browser.
20:05 MitchellSalad joined
20:05 <ph88> xxx.com your homepage ?
20:05 MitchellSalad joined
20:05 <monochrom> No.
20:05 <ph88> j/k :P
20:08 yellowj joined
20:08 inad922 joined
20:08 aradia joined
20:10 ninegrid joined
20:11 sophiag joined
20:11 ircbrowse joined
20:14 KarboniteKream joined
20:16 <infandum> cocreature: Can I write an instance of Foldable for Unboxed that obeys the rules?
20:18 <AWizzArd> If you search for „let generalization” on this page, what does it mean? http://www.haskellforall.com/2014/10/how-to-desugar-haskell-code.html
20:18 uglyfigurine joined
20:19 <infandum> cocreature: Like, cheat the system without breaking anything?
20:21 <lyxia> AWizzArd: https://en.wikipedia.org/wiki/Let_generalization
20:23 <AWizzArd> lyxia: oki thanks
20:23 merlynfry joined
20:24 jship joined
20:27 orbifx joined
20:27 modal joined
20:30 dredozubov joined
20:30 kuribas joined
20:30 <glguy> infandum: You can't write a Foldable instance for unboxed Vector, You need the Unbox constraint to read elements out of the vector
20:31 stef204 joined
20:31 chenshen joined
20:32 yogsotot_ joined
20:33 CurryWurst joined
20:34 robertkennedy joined
20:35 peterbec` joined
20:36 n1 joined
20:36 bollu joined
20:37 Sh4rPEYE joined
20:38 ChaiTRex joined
20:38 <infandum> glguy: Okay, that's what I feared.
20:40 marsam joined
20:42 b_perez joined
20:42 zero_byte joined
20:44 <b_perez> Currently reading through the GHC as a library wiki page. Confused about the DynFlag settings in section 4/ I get errors when I use them in my own code. Why are they using Opt_Cpp, Opt_ImplicitPrelude, Opt_MagicHash?
20:44 newguy joined
20:44 <b_perez> for reference: https://wiki.haskell.org/GHC/As_a_library
20:45 <newguy> Hi while running *cabal configure* I get
20:45 <newguy> cabal: At least the following dependencies are missing: tagged >=0.4.4 && <1
20:45 <newguy> but on doing cabal install tagged I get
20:46 <newguy> cabal: There is no package named 'tagged'.
20:46 <newguy> Any help is appreciated
20:46 umib0zu left
20:46 Itkovian_ joined
20:46 <mizu_no_oto_work> newguy: "cabal update", "cabal install --dependencies-only"?
20:47 bjz joined
20:47 <newguy> cabal install --dependencies-only gives me http://lpaste.net/5346536394284072960
20:48 <newguy> cabal update returns "Skipping download: Local and remote files match."
20:49 <mizu_no_oto_work> Are you cabal installing stuff globally, out of curiosity?
20:49 Koterpillar joined
20:49 <newguy> no idea :(
20:49 locallycompact joined
20:50 <newguy> I am a newbee in cabal
20:50 e14 joined
20:51 <mizu_no_oto_work> did you ever run "cabal sandbox init", for example?
20:51 <lyxia> newguy: what's in .cabal/packages/hackage.haskell.org/ ? http://stackoverflow.com/questions/30982195/cabal-update-local-and-remote-files-match
20:51 <newguy> no
20:51 <mizu_no_oto_work> Take a look at http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/
20:51 <tobiasBora> Hello,
20:52 SASQUATCH joined
20:52 <mizu_no_oto_work> newguy: Basically, just cabal installing stuff isn't really a great idea, since you have a global database of packages that needs self-consistent versions for everything
20:52 <tobiasBora> How would you do using Parsec something like "I would like a string containing this set of char (like letters and dots), but I would like it to end with a letter.
20:52 <mizu_no_oto_work> newguy: cabal sandboxes are the old hotness for getting around that
20:53 mda1 joined
20:53 <mizu_no_oto_work> if you got into a weird state, you could just delete the .cabal-sandbox folder everything was built in, in your project
20:53 <mizu_no_oto_work> and cabal new-build is the new hotness
20:54 <lyxia> tobiasBora: can there be more stuff after the string?
20:54 <newguy> k thank you very much
20:54 <tobiasBora> lyxia: yes
20:54 <tobiasBora> lyxia: Basically I'm trying to find an email in a text
20:55 Salih joined
20:56 <newguy> now on cabal update I am getting cabal: Codec.Compression.Zlib: premature end of compressed stream
20:56 <newguy> I cleared .cabal/packages/hackage.haskell.org/ directory
20:56 Rodya_ joined
20:56 Rainb joined
20:57 psychicist__ joined
20:58 <lyxia> tobiasBora: Say the set is letters and dots, then you can start with some (try (liftA2 (++) <$> many dots <*> some letter))
20:59 Miroboru joined
20:59 <ph88> i'm trying to http with bloodhound/elasticsearch anyone know how i can just print the response body ? https://bpaste.net/show/add1c0d3cfc3
20:59 scinawa joined
21:00 prooftechnique joined
21:00 <monochrom> lyxia: That's neat.
21:01 takle joined
21:01 Dykam joined
21:01 oish joined
21:02 <monochrom> Reminds me of the horror days when I needed to prove (0|1)* 0 = (1* 0+)+
21:02 <lyxia> :)
21:04 `^_^v joined
21:04 Luke joined
21:05 <lyxia> ph88: you're using responseBody from the wrong package
21:06 <lyxia> ph88: you need https://hackage.haskell.org/package/http-client-0.5.6.1/docs/Network-HTTP-Client.html#v:responseBody
21:07 bollu joined
21:08 strykerkkd joined
21:08 stryker_kkd joined
21:08 robkennedy joined
21:09 <ph88> i thought i was using that version of responseBody all along o_O
21:10 <ph88> ah right i'm using this one https://hackage.haskell.org/package/req-0.2.0/docs/Network-HTTP-Req.html#v:responseBody
21:10 <lyxia> That's it.
21:10 {emptyset} joined
21:12 louispan joined
21:12 diminishedprime joined
21:13 oisdk_ joined
21:17 mkoenig joined
21:18 marsam joined
21:22 tomku joined
21:23 fizruk joined
21:23 sshine joined
21:24 Durbley joined
21:24 sbrg joined
21:24 sbrg joined
21:25 <Durbley> Does anyone know of a freely available Haskell video lecture series by an established expert that's reasonably complete but accessible to someone with a modest background in math/computer science
21:26 moth joined
21:26 featherlessbiped joined
21:26 <sophiag> Durbley: i like erik meijer's lectures to accompany graham hutton's Programming in Haskell book
21:27 ubsan_ joined
21:27 <Durbley> thanks sophiag. is this it https://www.youtube.com/watch?v=rlwSBNI9bXE&index=11&list=PLX15ZXZzrWp5l1WkN5VkhmrbVp_ybNFRZ?
21:28 <Durbley> https://www.youtube.com/watch?v=rlwSBNI9bXE&index=11&list=PLX15ZXZzrWp5l1WkN5VkhmrbVp_ybNFRZ
21:28 dawehner joined
21:28 <sophiag> yup
21:28 ChaiTRex joined
21:29 JeanCarloMachado joined
21:30 <Durbley> sophiag, I don't see much on monads/applicatives?
21:30 <monochrom> That would be strange. Erik Meijer was the one who brought monad as LINQ to C#.
21:31 <sophiag> that series definitely covers monads
21:31 arctictern joined
21:31 <monochrom> Every time he writes for ACM Queue it's yet another monad tutorial again.
21:32 <sophiag> not that many books have a _whole_ lot on applicatives since they were all written prior to 2014 when applicative style became standard
21:32 <sophiag> someone told me Programming in Haskell is being updated though so that sounds promising
21:32 <Rembane> Burritofest!
21:32 <Durbley> I'm looking at lecture 9 where he's talking about IO. But I don't see any other monad examples in other lecture descriptions
21:33 <sophiag> "a burrito is a monoid in the category of endofunctors"
21:33 <sophiag> Durbley: is that the one on parsers? i haven't watched it all tbh
21:33 <Durbley> No. But in this one he did say "we saw monads when we covered parsers"
21:33 <Durbley> but based on what he's saying now I don't think it was detailed
21:33 bjz joined
21:34 <sophiag> ah yeah, ok. so i tihnk that's when he first introduces them
21:35 uglyfigurine joined
21:35 <Durbley> but no State, Reader, Applicatives?
21:35 <sophiag> isn't there a list of topics?
21:35 ddere joined
21:35 <Durbley> as far as I see each video has one but I cant find one list
21:36 <Durbley> I tried to go to the homepage in the description but that led to the book you mentioend
21:36 peterbec` joined
21:37 <sophiag> yeah, the list of videos isn't that helpful
21:37 Koterpillar joined
21:37 Fairy joined
21:40 <Durbley> I downloaded all the slides and skimmed them. I've learned almost all of this already :|
21:40 <Durbley> no Reader, State, Applicatives, or further Monad examples
21:40 Detrumi joined
21:41 takuan joined
21:42 <jle`> can i get stack to output all of the ghc versions in scope?
21:42 <kadoban> jle`: "in scope" ? All of the ones it installed you mean? (but if so, no I don't think so)
21:43 <jle`> all of the ones it will accept if i did stack build --compiler XX
21:44 <kadoban> Oh that, hmm. Not that I know of, but that's a good question.
21:46 wtetzner joined
21:46 ahihi joined
21:46 darthdeus joined
21:47 darjeeling_ joined
21:47 beaky joined
21:48 e14_ joined
21:50 diminishedprime joined
21:53 wayne joined
21:53 wayne joined
21:53 hiratara joined
21:53 zv joined
21:53 atomi joined
21:53 Luke joined
21:54 systadmin joined
21:54 mkoenig joined
21:55 rjeli joined
21:56 coot joined
21:56 rribeiro joined
21:58 locallycompact joined
21:58 ebzzry joined
21:59 <dawehner> Hi
21:59 <dawehner> Does it make sense to implement applicative for a Map?
21:59 <ChaiTRex> hello.
21:59 <dawehner> It feels like it could make sense by ignoring the keys?
21:59 <Koterpillar> dawehner: can you uphold its laws?
21:59 <Koterpillar> ChaiTRex: hello
22:00 <dredozubov> dawehner: how would you implement pure?
22:00 <Koterpillar> maybe if the key is a monoid...
22:00 <dawehner> dredozubov: I guess you indeed can't
22:01 <Koterpillar> but then I don't know what use is that
22:01 <dawehner> right if key is a monoid it could be just mempty
22:01 <Koterpillar> but then you'll have to do cartesian product for bind
22:02 <Koterpillar> I mean <*>
22:02 <dawehner> Right for <*> you'd probably loose the keys on both sides
22:02 <dawehner> ... in case you just deal with the value level
22:03 <Koterpillar> no, you use mappend
22:03 <Koterpillar> in fact, you have to, if you use mempty for pure
22:03 tswett_to_go joined
22:03 <dawehner> well, what happens if you have the same keys in mappend ?
22:04 alexknvl joined
22:04 <Koterpillar> not what you expect
22:05 <dawehner> Koterpillar: yeah the more I think about it, the less I think it could be useful (if it would be implementable)
22:05 <Koterpillar> liftM2 (+) (M.fromList [("a", 1)]) (M.fromList [("b", 2)]) == M.fromList [("ab", 3)]
22:05 lukaramu_ joined
22:05 JeanCarloMachado joined
22:06 mikecaruso joined
22:07 <tswett_to_go> Hey there. So I'm writing a package. I'm wondering if I can have a module export a function in such a way that the function can be used by any module inside the package, but not outside the package.
22:07 <tswett_to_go> Kind of like the "internal" access modifier in C#.
22:07 <pikajude> if you don't export the module sure
22:08 Renard_Chase joined
22:08 <tswett_to_go> Well... that sounds pretty easy. :)
22:08 <tswett_to_go> Thanks.
22:09 eazar001 joined
22:09 <pikajude> then it's a "package-private" module
22:10 <pikajude> don't go too hogwild with private members though
22:10 <Renard_Chase> I don't know if this exactly goes here, but when I try to run ' floor ((log 10) * 3) ' in Haskell (and Lua) I get 6, but when I run it through my graphing calculator (or a website that does the same) I get 3, and I don't know what to make of those results
22:10 <pikajude> one of the cryptohash libraries exports a newtype wrapper for ByteString but not the constructor itself so you can't get the bytestring out @_@
22:11 atomi joined
22:11 <geekosaur> Renard_Chase, look for a "ln" function on your graphing calculator
22:12 <geekosaur> most calculators default to log base 10; most computers to log base e
22:12 <Renard_Chase> Ah, I didn't know that
22:12 <Renard_Chase> Thanks
22:12 zero_byte joined
22:12 twanvl joined
22:12 <geekosaur> (ln or logn, ... "natural logarithm")
22:14 peterbec` joined
22:14 uglyfigurine joined
22:14 atomi joined
22:16 conal joined
22:16 JeanCarloMachado joined
22:16 castlelore joined
22:16 castlelore joined
22:17 refold joined
22:17 ludat joined
22:17 worch joined
22:17 Voldenet joined
22:17 Voldenet joined
22:19 darjeeling_ joined
22:19 <ph88> how can i index a document while not supplying an ID ? https://hackage.haskell.org/package/bloodhound-0.13.0.0/docs/Database-V5-Bloodhound-Client.html#v:indexDocument https://hackage.haskell.org/package/bloodhound-0.13.0.0/docs/Database-V5-Bloodhound-Types.html#t:DocId
22:19 <ph88> "Can be set by the user or created by ES itself."
22:19 <dmwit> dawehner: http://hackage.haskell.org/package/total-map is a Map-like that offers an Applicative and Monad instance
22:19 <ph88> but the indexDocument function requires i give the id
22:20 <dawehner> dmwit: thank you!
22:20 Denthir joined
22:20 <dmwit> dawehner: The instances are "zippy": `liftM2 f m1 m2` aligns matching keys in `m1` and `m2` and applies `f` to their respective values.
22:21 <ph88> bitemyapp around ?
22:21 louispan joined
22:22 <dawehner> dmwit: and it throws away the others?
22:23 <dmwit> The maps are total. There are no others. =)
22:23 coot joined
22:24 <dmwit> Think of `TMap k v` as just being another in-memory representation of `k -> v`. The instances are "the same" in that regard.
22:25 <Koterpillar> then aren't those instances just (a ->) in disguise?
22:25 worch joined
22:25 <dmwit> I think I just said that, yes.
22:26 <ReinH> Perhaps those instances are equivalent to those of (r ->).
22:26 animated joined
22:26 <* Koterpillar> needs to not selectively read the left part of the chat
22:28 <ReinH> It could be the case that the instances of TMap k correspond to those of (k ->).
22:28 rribeiro joined
22:30 tromp joined
22:31 hiratara joined
22:33 louispan joined
22:33 JeanCarloMachado joined
22:37 worch joined
22:37 alexknvl joined
22:37 cmsmcq joined
22:39 eschnett joined
22:42 thimoteus joined
22:42 louispan joined
22:42 systadmin joined
22:42 coot joined
22:43 Gloomy joined
22:44 e14 joined
22:45 Rodya_ joined
22:47 yogsotot_ joined
22:47 latro`a joined
22:48 <dawehner> Thank you for all your help, I need to let this settle for a map
22:48 Rainb joined
22:48 <dawehner> *for a while :)
22:51 merlynfry left
22:51 lambda-11235 joined
22:53 anuxivm joined
22:54 conal joined
22:54 epsilonhalbe joined
22:54 <Renard_Chase> Any easy way to round a number to the nearest fourth?
22:55 haskull joined
22:55 <haskull> does UArray not support tuple values? normal array and Vector.Unboxed does :/
22:55 <mniip> Renard_Chase, times 4, round, over 4
22:56 stoopkid joined
22:57 snowalpaca joined
22:57 <geekosaur> haskull, tuples are boxed. Vector.Unboxed may be telling a convenient lie; UArray doesn't tell that lie
22:58 snowalpa_ joined
22:58 <haskull> geekosaur: is my best option to encode it as an int, then?
22:59 <haskull> encode the values in the tuple*
22:59 <geekosaur> possibly
23:00 <geekosaur> Vector is more recent and can take advantage of machinery that Array couldn't and possibly can't; unboxing can be "interesting" to implement
23:01 <Renard_Chase> mniip: Thanks
23:01 alx741 joined
23:03 alx741 joined
23:04 jship joined
23:07 JeanCarloMachado joined
23:08 laxask joined
23:08 eyck joined
23:10 Boomerang joined
23:12 epsilonhalbe left
23:14 edwtjo joined
23:14 edwtjo joined
23:14 yogsototh joined
23:17 kolmodin joined
23:18 gienah joined
23:21 peterbec` joined
23:22 <Squarism> Judging by the issue count the two largest haskell logging frameworks (according to google) haskell users : dont use these or they were perfectly implemented from start?! Any other ideas?
23:23 marsam joined
23:23 theDon_ joined
23:25 Voldenet joined
23:26 vedlin joined
23:26 Voldenet joined
23:26 louispan joined
23:27 gugah joined
23:27 gugah joined
23:27 nakal_ joined
23:27 markus1209 joined
23:28 s4kashya joined
23:28 markus1219 joined
23:29 CMCDragonkai joined
23:30 Tharbakim joined
23:31 aarvar joined
23:31 systadmin joined
23:37 systadmin joined
23:41 oisdk joined
23:42 arpl left
23:44 ChaiTRex joined
23:44 Conjecture joined
23:44 <Conjecture> Is there a way to get a buffer that allows me to write to each element of it once and never again?
23:45 <Conjecture> In order
23:46 sleffy joined
23:46 Rodya_ joined
23:47 wtetzner joined
23:49 splanch joined
23:51 sleffy joined
23:54 sz0 joined
23:54 geekosaur joined
23:55 Unhammer joined
23:55 <glguy> That's what ByteString.pack or Vector.fromList effectively
23:55 <glguy> do
23:56 suls joined
23:56 YongJoon joined
23:58 ana_ joined
23:58 <ana_> ?src ($)
23:58 <lambdabot> f $ x = f x