<     May 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:02 infinity0_ joined
00:02 infinity0_ joined
00:04 gawen joined
00:04 infinity0 joined
00:04 systadmin joined
00:05 jb55 joined
00:06 biglambda joined
00:06 modlin joined
00:07 infinity0 joined
00:08 Wizek__ joined
00:08 Wizek joined
00:09 sssilver joined
00:10 infinity0 joined
00:12 infinity0 joined
00:13 <ReinH> mniip: false
00:14 <mniip> false as in not point-free or as in actually not pointless?
00:15 <ReinH> Yes.
00:16 jao joined
00:17 <ReinH> parseStream contains a point, and it's an instructive presentation of parsing.
00:17 <mniip> right
00:18 <mniip> looked over that somehow
00:18 <ReinH> :p
00:19 <ReinH> I like parameterizing by choice of non-determinism monad. It makes a nice presentation of things like L-Systems too.
00:19 connrs joined
00:19 <ReinH> A choice choice.
00:22 <* mniip> . o O ( class Parser p where token :: p b t t; parse :: p b t a -> (s -> b (t, s)) -> b a )
00:22 <mniip> a choice choice choice
00:22 <EvanR> fix choice
00:22 <mniip> = Proxy
00:23 <ReinH> mniip: pbtt yourself
00:24 <mniip> *s t a b*
00:26 Beetny joined
00:26 mizu_no_oto_work joined
00:27 augur joined
00:31 shayan_ joined
00:32 dsh joined
00:32 FoxM joined
00:32 biglambda joined
00:33 uuplusu joined
00:34 mizu_no_oto_work joined
00:34 tromp joined
00:35 hiratara joined
00:36 jedws joined
00:36 moth joined
00:37 <Gurkenglas> Where do I put something instead of "~/.ghci" if I'm using stack ghci?
00:37 robkennedy joined
00:37 <ReinH> I thought it still used that file
00:38 <geekosaur> you might want the local .ghci file
00:38 <geekosaur> (that is, ghci will read a .ghci in the directory you run t from if one exists)
00:39 isBEKaml joined
00:40 Durbley joined
00:43 jmcarthur joined
00:50 oisdk joined
00:50 verement joined
00:51 hiratara joined
00:51 louispan joined
00:53 <iqubic> What does the Huge function do?
00:53 <iqubic> Huge 0 3
00:53 <iqubic> > huge 0 3
00:53 <lambdabot> 4
00:53 <iqubic> > huge 2 3
00:53 <lambdabot> 24
00:54 <mniip> :t huge
00:54 <lambdabot> Int -> Integer -> Integer
00:54 <iqubic> > huge 4 4
00:54 <mniip> I suspect it might be ackermann or a related function
00:54 <lambdabot> mueval-core: Time limit exceeded
00:54 <iqubic> > huge 4 1
00:54 <lambdabot> 2
00:54 <ertes> @undef
00:54 <lambdabot> Undefined.
00:54 <ertes> @let huge :: Int -> Integer -> Integer; huge 0 x = x + 1; huge n x = foldl' (flip ($)) x (replicate (fromInteger x) (huge (n - 1)))
00:54 <lambdabot> Defined.
00:54 <mniip> yup, ackermann
00:54 a_3gg joined
00:55 <ertes> you can probably optimise it, because there are easy formulas for the lower indices
00:58 typedrat joined
01:00 <ij> Does anyone have a repo on github that can be build and run with docker? (preferably the alpine kind)
01:00 <ij> Whatever it is, I just want to see it workk.
01:01 <ertes> ij: you mean a haskell app that runs in docker?
01:01 <ij> Yeah, and … with stack, I guess.
01:02 <ertes> the two seem orthogonal… a haskell application running in docker is fairly easy to create using e.g. nix
01:03 systadmin joined
01:03 louispan joined
01:04 <ij> I tried following https://www.reddit.com/r/haskell/comments/67c0a9/can_you_run_ghc_executables_in_an_alpine_linux/dgpzkdy/ , but that seems like broken advice.
01:05 <ertes> ij: i don't know anything about alpine, but for example nix produces full-closure images, so they should run everywhere, as long as it's the same architecture
01:06 <ij> Ugh, I have to learn nix, I guess. ;_;
01:06 <ertes> i can quickly create a small example, if you want
01:06 <ij> I was about to go to sleep.
01:07 <ij> I know you're a regular here, maybe let's do it at some point in the near future?
01:07 <ertes> sure
01:07 <ij> night night
01:07 <ertes> good night
01:07 lambdamu joined
01:09 ludat joined
01:13 castlelore joined
01:13 jer1 joined
01:14 <dmj`> ij: there is some work being done in nix to allow the libc in stdenv to be swapped out for musl.
01:14 slack1256 joined
01:14 Costar joined
01:15 _mu_ joined
01:16 Guest58276 joined
01:17 <ertes> it would be much more useful, if GHC were a multi-output package
01:18 <ertes> unless you compile with static linking, the closure of haskell programs is well above 1.5 GiB
01:18 soLucien joined
01:20 Supersonic112_ joined
01:42 irclogger_com joined
01:42 Topic for
01:42 hololeap joined
01:42 twomix joined
01:43 <joe9> http://codepad.org/BhXlJCmN I need to get my head around these numbers . any help, please?
01:43 <joe9> http://codepad.org/2e4Ru3uj is what I am trying to do.
01:43 <joe9> http://codepad.org/ED5Ucgra is the error
01:44 <Cale> :t Data.Fixed.div'
01:44 <lambdabot> (Real a, Integral b) => a -> a -> b
01:44 <hololeap> does anybody know an abstraction that would make this function more concise and understandable:
01:44 <joe9> got it, need a fromIntegral
01:45 <EvanR> why is that in Data.Fixed... seems generally useful
01:45 <Cale> joe9: Or perhaps you have the arguments the wrong way around?
01:45 <MarcelineVQ> :t 2.5
01:45 <lambdabot> Fractional t => t
01:45 <Cale> oh, maybe not
01:45 <joe9> oPlotBoxPrice :: Double -> Price -> Price
01:45 <joe9> toPlotBoxPrice i p = (fromIntegral (Data.Fixed.div' p i)) * i
01:45 <joe9> is what I ended up doing.
01:45 <hololeap> :t (\m f -> maybe id f m)
01:45 <lambdabot> Maybe a1 -> (a1 -> a -> a) -> a -> a
01:47 Argue joined
01:49 <hololeap> sorry, i'm trying to figure out how to properly explain the idea
01:50 mkoenig joined
01:50 <lyxia> flip (maybe id)
01:51 <Gurkenglas> :t alaf Endo foldMap
01:51 conal joined
01:51 <lambdabot> Foldable t => (a1 -> a -> a) -> t a1 -> a -> a
01:51 <hololeap> i guess what i'm looking for is conditional processing, so it either applies a function to an argument or it doesn't, depending on conditions encoded in the argument
01:52 coot joined
01:52 <EvanR> (a -> b) -> Either a a -> b
01:52 <hololeap> so like a Maybe specifically for functions where Nothing would just apply id
01:52 <Gurkenglas> Yes, you are talking about the Endo monoid.
01:52 <mniip> :t fromMaybe id
01:52 <lambdabot> Maybe (a -> a) -> a -> a
01:53 <hololeap> Gurkenglas: nice, i was just wondering what that was useful for today!
01:54 jcjf joined
01:55 <Gurkenglas> mniip thats just worse ala Endo foldMap :P
01:55 strawberry joined
01:55 <mniip> alright
01:56 <hololeap> Gurkenglas: unfortunately, i still don't know how to use it
01:57 augur joined
01:57 <Gurkenglas> Got sample code to make more concise?
01:57 fosterite joined
01:58 <Cale> fromMaybe id is a good deal easier to understand than ala anything
01:58 <Cale> :t alaf
01:58 <lambdabot> (Rewrapped t s, Rewrapped s t, Functor g, Functor f) => (Unwrapped s -> s) -> (f t -> g s) -> f (Unwrapped t) -> g (Unwrapped s)
01:59 <mniip> sounds simple enough
01:59 <Cale> ... unnecessary
01:59 <mniip> :t alaf Endo
01:59 <lambdabot> (Functor f, Functor g) => (f (Endo a) -> g (Endo a)) -> f (a -> a) -> g (a -> a)
01:59 <Gurkenglas> i admit worse was just a cheeky formulation of "less general"
02:00 <hololeap> (\c -> maybe id (filter . (<)) c) :: Maybe (Int, Int) -> [(Int, Int)] -> [(Int, Int)]
02:00 hucksy joined
02:01 <Gurkenglas> Where'd the Maybe come from?
02:01 <mniip> \c -> fitler (maybe (const False) (< c))
02:01 <hololeap> another function returns a Maybe (Int, Int)
02:01 <Gurkenglas> (by the way you can already eta reduce that to "maybe id (filter . (<))")
02:01 <mniip> (c <) rather
02:01 <mniip> no wai
02:02 <mniip> \c -> fitler (maybe (const False) (<) c)
02:02 <hololeap> heil fitler?
02:03 bjz joined
02:03 <hololeap> Gurkenglas: how would i use Endo to abstract this?
02:04 <Gurkenglas> "alaf Endo foldMap (filter . (<))", but I'd say there's no reason to replace "maybe id (filter . (<))" with that just yet
02:05 <Gurkenglas> hololeap, if this is the only place you use the result of that function, you could have that function return "[(Int, Int)] -> [(Int, Int)]" instead
02:05 <Gurkenglas> ("that function" = the one that returns "Maybe (Int, Int)"
02:06 systemfault joined
02:07 <Gurkenglas> hololeap, alaf Endo foldMap makes sense iff it is conceivable that the Maybe might be replaced with other Foldables
02:08 <hololeap> oh, it actually comes from a recursive call :) e.g. the function takes a Nothing when it is first called and it passes a piece of the previous call's environment on further iterations
02:08 <hololeap> so i could just abstract it with StateT
02:08 augur joined
02:08 <hololeap> or could i? i'm a bit confused
02:08 verement joined
02:09 <Gurkenglas> you could pass id initially and replace it with filter (<c) once you get hold of a c
02:09 <hololeap> interesting idea
02:09 ali_bush joined
02:09 ali_bush joined
02:11 <hololeap> but I would still want the Maybe to be there since it conceptually embodies the idea of there not being an initial state
02:11 <EvanR> mmmm
02:12 <EvanR> that usage of Maybe sounds suspicious
02:12 <EvanR> "no state" is a state
02:12 beerdrop joined
02:12 <EvanR> paradoxically
02:12 <hololeap> i'm trying to solve a variation of the n-queens problem and my current algorithm isn't the best, but i'm trying to clean it up a bit
02:13 <hololeap> i'm not sure if the code works in its current state but i'll post it
02:13 conal joined
02:14 ExpHP joined
02:15 <hololeap> https://gist.github.com/hololeap/0e0e72d3c4b5010c5f62938090c8ed51
02:15 <hololeap> line 42 is the function
02:16 <hololeap> this is after me screwing with it, hang on ...
02:16 <hololeap> ok it is closer to the original now
02:17 jer1 joined
02:18 dmh joined
02:18 tristanp joined
02:20 hel-io joined
02:20 plot joined
02:21 matthewbauer joined
02:21 <hololeap> so anyway the algorithm works by keeping track of the "safe" tiles (where a queen on the board can't hit) and tries recursively applying this function on each safe tile
02:22 <hololeap> so it adds a queen to the first safe tile, recurses, keeps the result, then moves on to the next tile
02:22 <hololeap> the Maybe is to keep track of which tile it is currently on. so, it starts as a Nothing
02:23 <kadoban> The usual backtracking by placing a queen on each row thing will work, right? Just the checks are a tad more tedious than the optimized one.
02:24 <hololeap> i haven't learned any methods to solve it, i'm just trying to figure it out as an exercise
02:25 <hololeap> anyway, my real question was about abstracting Maybe so that it either processes another value based on the Maybe or just does `id otherVal`
02:25 <hololeap> they just asked where the Maybe was from and i couldn't think of a way to explain it other than to post the code...
02:26 <kadoban> Oh I see. Heh I get distracted by algorithms easily :)
02:27 <hololeap> kadoban: i have heard of that method, but i still don't fully grasp how it works.
02:27 splanch joined
02:28 <kadoban> It's essentially just a brute-force search, except it stops broken solutions early
02:28 <hololeap> kadoban: that's exactly how one would describe my current algorithm, no?
02:29 kay joined
02:29 <hololeap> i have to admit the problem kind of perplexes me, and i feel like there is something deeper to learn from it
02:30 <hololeap> maybe mine doesn't stop broken solutions early enough. it just does a depth-first search. i also admit that my knowledge of algorithms is pretty novice
02:30 <kadoban> Sounds very similar at least
02:31 lavalike_ joined
02:32 <kadoban> The usual method explicitly encodes that there is no possible way to have two queens on the same row, and goes one row at a time, but other than that yours sounds very similar, just from the description you gave (didn't look at code yet)
02:32 <hololeap> i also want to find a way to optimize it so that it doesn't need to search for rotations of each solution
02:33 <hololeap> but, i digress...
02:33 modlin joined
02:35 exferenceBot joined
02:36 lavalike joined
02:39 nirvinm joined
02:39 uuplusu joined
02:40 hexagoxel joined
02:40 Argue_ joined
02:41 <justkkay> Google search displays millions of results. But Google limits users to only 1000 links or so to be seen. Is it possible to access the millions of links?
02:41 plot joined
02:42 <kadoban> justkkay: I kind of doubt it.
02:43 <hololeap> Google starts to give you captchas when you get very far down the list
02:50 shayan_ joined
02:53 takle joined
02:55 meba joined
02:56 tromp joined
03:00 _mu_ left
03:00 splanch joined
03:01 lukesp joined
03:01 <ab9rf> it's possible, but you'll have to apply to google for an API key and explain why you need that level of access.
03:01 felixsch__ joined
03:02 filterfish joined
03:02 <hololeap> because, you know, their mission "is to organize the world's information and make it universally accessible and useful"
03:02 <hololeap> universally accessible for those they approve
03:02 <ab9rf> no, their mission is to make money
03:03 <hololeap> this is out of their own mouth
03:03 filterfish joined
03:03 <ab9rf> in their case, by organizing the world's information and making it accessible and useful to those willing to pay whatever they decide is reasonable.
03:03 <ab9rf> shrug, i don't have a problem with it
03:03 <ab9rf> you're free to build your own search engine
03:04 <ab9rf> and this is OT, so discussion terminated :)
03:04 otto_s joined
03:04 jmcarthur joined
03:04 hydraz joined
03:05 filterfish joined
03:05 ChaiTRex joined
03:06 <justkkay> how does one build your own search engine? Is there a way to find all the existing websites?
03:07 meba joined
03:07 <ChaiTRex> justkkay: One way is to look at links.
03:07 <ChaiTRex> justkkay: Those show you some servers you may not have known about.
03:07 <hololeap> nmap -p- -iR 0
03:07 [[[[[ExTRa]]]]] left
03:08 <hololeap> scan all the things
03:09 plot joined
03:10 <koala_man> justkkay: traditionally you wrote your own crawler that followed links recursively. today you'd start with commoncrawl
03:11 takle joined
03:12 Shatnerz joined
03:13 filterfish joined
03:14 biglambda joined
03:14 JeanCarloMachado joined
03:17 doyougnu joined
03:18 xtreak joined
03:18 Xanather joined
03:19 takle joined
03:21 aaron7 joined
03:21 louispan joined
03:21 lukesp joined
03:30 uuplusu joined
03:31 splanch joined
03:31 blob_ joined
03:32 jhorwitz joined
03:32 <jhorwitz> clear
03:34 splanch_ joined
03:36 systadmin joined
03:37 sleffy joined
03:38 markasoftware joined
03:42 robertkennedy joined
03:43 alv3da joined
03:44 <alv3da> Anyone up?
03:44 <alv3da> i need help
03:46 JeanCarloMachado joined
03:46 bjz joined
03:49 <kadoban> alv3da: Usually better to just ask your followup. There's many many people here.
03:54 <alv3da> can someone tell me where can i contact a hacker who can help me hacking an android device
03:54 <kadoban> Not here.
03:56 <mniip> not on this network
03:56 dan_f joined
03:57 gspia joined
03:58 mizu_no_oto_work joined
03:58 JeanCarloMachado joined
03:59 splanch_ joined
04:00 felixsch_ joined
04:00 WhiskyRyan joined
04:01 <glguy> Is it possible to get Hackage to syntax highlight Haskell source in Markdown files (specifically the readme.md). I tried ```haskell ... ```
04:01 splanch__ joined
04:02 filterfish joined
04:03 splanc___ joined
04:04 takle joined
04:04 <alv3da> atleast tell me the room
04:04 <mniip> 1494129382 [06:56:22] <mniip> not on this network
04:05 splanch_ joined
04:05 uuplusu_ joined
04:06 hazyPurple joined
04:06 geekosaur joined
04:06 alv3da left
04:07 mjora7 joined
04:11 takle joined
04:11 <glguy> (In absense of a hackagebot) I uploaded my new library for parsing information out of configuration files. It's similar to optparse-applicative in how you use it: https://hackage.haskell.org/package/config-schema The example in the readme has syntax highlighting if you look at it on github https://github.com/glguy/config-schema
04:12 <glguy> The larger use of it is in my irc client
04:15 <mniip> I don't think I've ever seen syntax highlighting in that part of hackage
04:15 biglambda joined
04:15 <glguy> OK, it might well not be possible.
04:15 <mniip> not sure if what you're asking for is at all implemented
04:15 infinity0 joined
04:17 pierrot joined
04:18 takle joined
04:20 <glguy> The package makes extensive use of generalized newtype deriving to avoid having to write various Functor/Applicative/Monoid/Alt/etc. instances and and takes advantage of GADTs if anyone was looking for a small example of either
04:20 Maxdamantus joined
04:23 shesek joined
04:23 shesek joined
04:24 ericsagnes joined
04:24 crave_ joined
04:24 <MarcelineVQ> glguy: this is relevant to me
04:25 <MarcelineVQ> iow thanks :>
04:26 splanch joined
04:31 plot joined
04:37 takle joined
04:38 hazyPurple joined
04:40 pierrot joined
04:41 dfordivam joined
04:43 Hjulle joined
04:44 litchblade joined
04:47 matthewbauer joined
04:51 gaze__ joined
04:54 xcmw joined
04:54 takle joined
04:55 enitiz joined
04:56 prophile joined
04:56 matthewbauer joined
04:57 geekosaur joined
05:11 augur joined
05:11 conal joined
05:12 eklavya joined
05:12 takle joined
05:12 <rotaerk> :i tug
05:13 nurupo joined
05:13 osa1 joined
05:13 osa1 joined
05:16 tromp joined
05:19 sproingie joined
05:19 sproingie joined
05:20 louispan joined
05:24 mkloczko joined
05:25 simukis joined
05:31 takle joined
05:31 WhiskyRyan joined
05:34 MrWoohoo joined
05:36 plutoniix joined
05:36 <rotaerk> hmm... just wrote some hideous code; time to simplify...
05:37 plutoniix joined
05:39 bairyn joined
05:42 takle joined
05:44 WhiskyRyan joined
05:47 brynedwards joined
05:48 uuplusu joined
05:53 Shatnerz joined
05:55 wonko7 joined
05:56 conal joined
05:57 cschneid_ joined
06:00 takle joined
06:00 BartAdv joined
06:07 takle joined
06:08 leah2 joined
06:09 geekosaur joined
06:10 dooml0rd joined
06:12 xall_ joined
06:15 augur joined
06:16 teggi joined
06:18 mohsen_ joined
06:18 slack1256 joined
06:18 plot joined
06:19 ertes joined
06:20 <sophiag> i'm playing around with backtracking search using continuations and because mplus isn't associative it won't coverge on a solution, but instead of defining a custom mplus i figured i could just use <|> since cont should have an applicative instance now. however, ghci is requiring me to use an Alternative constraint and still failing just as when i used the mplus from Control.Monad. i'm confused as to why this isn't working
06:20 xall joined
06:21 litchblade joined
06:22 augur joined
06:26 <Cale> sophiag: mplus should be associative
06:26 Costar joined
06:27 fluffystub joined
06:27 mda1 joined
06:29 mrkgnao joined
06:29 <sophiag> Cale: i just found Oleg's site :p
06:30 <sophiag> so going through all his stuff and having my mind blown
06:30 <Cale> haha, he's got years and years of it to go through :)
06:30 <sophiag> this is from here: http://okmij.org/ftp/continuations/Searches.hs
06:30 <sophiag> it's true the search doesn't terminate with regular mplus and does with his
06:31 <sophiag> i originally just wanted to learn enumerators then found this and now have no time left in the day. lol
06:31 <Cale> oh, perhaps his mplus isn't associative
06:31 mda1 joined
06:31 <Cale> The usual one is
06:32 <sophiag> he says the other way around
06:32 <sophiag> oh, he probably meant to say commutative
06:32 <sophiag> it makes sense it would be associative but non-commutative
06:33 <sophiag> whereas <|> should be both
06:33 <mrkgnao> Cale: I did something terrible even though you advised me not to yesterday (I think). Well, rather, came close.
06:33 <Cale> I'm fairly sure he means that his mplus won't be associative.
06:34 <Cale> (the one implemented just above there)
06:35 <mrkgnao> fromIntegerP (Proxy :: Proxy 0) :: Neutral 'Add a => a
06:35 <mrkgnao> fromIntegerP (Proxy :: Proxy 1) :: Neutral 'Mul a => a
06:35 <mrkgnao> and for bigger numbers it imposes a Field constraint
06:36 <sophiag> i suppose that makes more sense. associative meaning a search won't terminate
06:37 <sophiag> oh yeah, what am i thinking...the typo is right there in the comments
06:38 <sophiag> "Generally speaking, mplus is not associative. It better not be..."
06:38 <sophiag> the first "not" is the typo
06:39 <mrkgnao> (should've been Ring above, sorry)
06:39 FreeBirdLjj joined
06:40 falafel joined
06:40 <mrkgnao> sophiag: the link you posted: :O
06:41 <sophiag> ikr?
06:42 nickolay joined
06:42 SlashLife joined
06:43 <sophiag> he also has the best zipper implementation i've seen. altho i've yet to try the one in the Lens library since they forked it
06:43 SpinTensor joined
06:43 Clouclou joined
06:44 <mrkgnao> somewhat similar weirdness: http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/
06:45 sizeofchar joined
06:47 <sophiag> this is all actually a lot like the DSL Cale helped me with a bit (that i never finished debugging). not surprising since it's based on Amb from Scheme and Oleg's a Scheme person
06:48 takuan joined
06:48 <sophiag> i planned on doing some stuff like this with it. actually the pythagorean triplets he uses to demo the backtracking searches in that code i linked to is the very first example for Amb in SICP
06:49 <sophiag> Cale: so if you're wondering what i was thinking with that thing... :D
06:49 ubsan_ joined
06:50 <mrkgnao> is Amb something like a list monad?
06:51 takle joined
06:51 <Cale> sophiag: You might also find http://okmij.org/ftp/papers/LogicT.pdf interesting
06:51 <mrkgnao> the only time I've ever heard of it is from the Conal Elliott episode of Haskell Cast, where he mentions it in passng
06:51 <Cale> https://hackage.haskell.org/package/logict
06:51 <Cale> mrkgnao: That's a different amb
06:52 vlatkoB joined
06:52 soniku joined
06:52 <Cale> Or rather, I would expect him to be talking about unamb :)
06:52 <sophiag> mrkgnao: holy shit! that post is by Martin Escardo who co-authored Calculus in coinductive form. that's one of my favorite papers. i'm actually including it in a talk i'm giving in a few weeks about automatic differentiation
06:52 <mrkgnao> Cale: yes, it was unamb
06:53 <sophiag> unamb?
06:53 <mrkgnao> something like a diamond-graph of dependencies would be what I understood
06:54 <mrkgnao> there's some ambiguity in the middle, but it can be resolved at the point where you ask for a concrete answer
06:54 <sophiag> Cale: thanks for the link. i guess that was before Oleg turned against monad transformers? tbh i agree with him on that one
06:54 <Cale> unamb :: a -> a -> a is a function which is meant to be provided with two semantically equivalent expressions, and it results in the first of the two which is available.
06:54 <mrkgnao> now obviously I don't know Scheme so this is all vague analogizing, and Cale knows better
06:54 mjora7 joined
06:55 <mrkgnao> Cale: what use would that be? something like the race* functions from async?
06:55 <Cale> yeah
06:55 <Cale> oh, also my description isn't quite right
06:56 <Cale> They have to be expressions which are either equal or bottom
06:56 <Cale> i.e. unamb _|_ y = y and unamb x _|_ = x
06:56 insitu joined
06:56 <mrkgnao> but how would you...?
06:56 <mrkgnao> whoa
06:56 <Cale> and yeah, it's sort of like race
06:57 <mrkgnao> so bottom is "infinitely delayed"?
06:57 <Cale> So, it behaves a bit like const
06:57 <Cale> except for both arguments :)
06:57 oisdk joined
06:58 <sophiag> i'm trying to remember the parallel (so to speak) for unamb in Go
06:58 <Cale> (it's really unsafe -- you have to ensure that the expressions will indeed be equal, since if you don't, it'll just pick between them in a way which depends on evaluation order)
06:59 <sophiag> ah, right. that's what i was imagining
06:59 <sophiag> it is still nondeterministic though?
06:59 MoALTz joined
06:59 <sophiag> hence the name?
06:59 <Cale> no, it just picks one
07:00 tsmish joined
07:01 <sophiag> oh *if* you make sure they're equal
07:01 <sophiag> otherwise it's like Go
07:01 <Cale> Yeah, it's a precondition that they're equal
07:01 <Cale> or else bottom
07:02 <Cale> It's okay if only one of the two is defined -- it will result in whichever of the two expressions becomes available first, so if one doesn't terminate, you'll get the value of the other
07:03 <sophiag> anyway, what i was thinking of in Go is called alt! in Clojure
07:03 <sophiag> it's the one Pike demos where he puts in Google searches and grabs the one that finishes first
07:04 Paul__ joined
07:04 <sophiag> mrkgnao: and Amb in Scheme does just do backtracking search
07:04 <mrkgnao> Speaking of bottom, I find it interesting that all the Haskell-ish languages that have been developed recently are strict by default, for different reasons.
07:05 <sophiag> it's much easier to write a decent compiler for a strict language
07:05 <dysfun> when i was designing my toy lisp, first thing i did was make it strict
07:05 <Paul__> is there a library that provides sorted sequence with index lookup (i.e., get its position in the queue)?
07:05 <Cale> Yeah, as much as I'd really like Idris to have been lazy, I totally understand why Edwin didn't want to spend a whole bunch of time on that aspect.
07:06 <mrkgnao> sophiag: alt! sounds exactly like race
07:06 <sophiag> also nearly all strict functional languages still have bottom. it just behaves differently
07:06 <sophiag> mrkgnao: i haven't used async yet actually
07:06 <Cale> Well, you don't really need the Scott domain semantics for strict languages.
07:07 <Paul__> I've browsed through all hackage and cannot find it. Ordered sets (from sets package) came close, but still it is not the same because its membership lookup is based on key, not value
07:07 <mrkgnao> yeah, pervasive laziness is actually super weird once you stop using it and start thinking about what it *means* (either for fun, or for compiler implementation)
07:07 <sophiag> Cale: why not? they all use them
07:07 <Cale> I suppose you could use it anyway though, and most values would just be inaccessible.
07:07 <sophiag> i think you're talking about something more specific than i am
07:08 <Cale> I'm talking about the definedness ordering of which _|_ is the least element.
07:08 meba joined
07:08 <Cale> (hence the name "bottom")
07:09 <Cale> e.g. for the type [Bool] you have _|_ at the bottom, and then immediately above that, you have [] and _|_ : _|_ which are incomparable
07:09 <Cale> and then above _|_ : _|_, you have False : _|_, True : _|_ as well as _|_ : [] and _|_ : (_|_ : _|_)
07:09 <Cale> all of which are incomparable
07:10 takle joined
07:10 <Cale> and just generally, things proceed in that fashion, with x <= y when one can substitute some occurrences of _|_ in x somehow in order to obtain y
07:12 NeozbiljnOzbilja joined
07:12 splanch joined
07:13 <sophiag> wait, but in strict functional languages it's bottom on one side of products thats leads to inconsistency. so doesn't that mean ordering of it does matter?
07:13 <mrkgnao> this kinda sorta sounds like instance selection rules for overlapping instances, Cale
07:13 <sophiag> like in ML (x,_|_) and (_|_,x) both evaluate to _|_
07:13 <Cale> Well, in a strict language, if you want to apply these semantics, anything will be totally defined or _|_
07:13 <Cale> There won't be anything in-between
07:14 vlatkoB_ joined
07:14 <Cale> (which makes it a bit of a waste -- most of the detail in the model is inaccessible via the language)
07:16 <sophiag> well, in practice we're fine either way. but ideally fst (x,_|_) == x
07:16 <sophiag> i suppose it's much like dividing by zero
07:17 takle joined
07:18 SlashLife joined
07:19 polll joined
07:20 DocWinter joined
07:20 sproingie joined
07:20 sproingie joined
07:22 osa1_ joined
07:23 gehmehgeh joined
07:23 afarmer joined
07:23 Kreest__ joined
07:23 benjamingr_ joined
07:27 MDA2 joined
07:28 hybrid joined
07:29 osa1 joined
07:30 razi1 joined
07:32 dni joined
07:37 srbaker__ joined
07:38 oisdk joined
07:40 fluffystub joined
07:43 osa1_ joined
07:46 nirvinm joined
07:53 insitu joined
07:53 soniku joined
07:54 fizruk joined
07:57 ccapndave joined
07:57 oish joined
07:57 <* dfordivam> /msg ALIS help
07:58 <ccapndave> Morning Haskellers. I am quite a noob to Haskell and can't figure out why this doesn't compile. The problem is that line 5 doesn't type check (error included in gist). Any ideas why? https://gist.github.com/ccapndave/5d35786e182e830ad197ce0a315bc9bc
07:58 xtreak joined
07:59 <glguy> .url
08:00 <glguy> ccapndave: By default Haskell doesn't have "scoped type variables"
08:00 <dfordivam> ccapndave: try -XScopedTypeVariables
08:00 <glguy> so the 'g' on line 5 is not related to the 'g' on line 1
08:00 <ccapndave> Ah
08:00 <ccapndave> But if I put another (RandomGen g) in there that doesn't work either (and neither if I give it a different type variable name)
08:01 _main_ joined
08:01 <ccapndave> e.g. random gen :: (RandomGen g1) => (Float, g1)
08:01 <glguy> Right, in this case it has a specific type , you just can't name that type
08:01 <glguy> If you write this type signature with g1, you're asserting that it has any type g1
08:01 <glguy> but it doesn't have any type, it has some specific type
08:01 jeltsch joined
08:01 <ccapndave> Ah, I see
08:02 __main__ joined
08:02 <glguy> > let x :: Int; (x,y) = (10,20) in x
08:02 <lambdabot> 10
08:02 <glguy> Since you are trying to give 'rand' a type signature and not the generator
08:02 <glguy> You can just add such a signature on the line before 5
08:02 <glguy> err, before 4
08:03 <glguy> dfordivam: Remember when suggesting -XScopedTypeVariables that it doesn't do anything without the extra 'forall' quantifiers
08:03 <ccapndave> glguy: Aha! rand :: Float
08:03 <ccapndave> That does it
08:04 __main__ joined
08:04 <ccapndave> Thanks very much :)
08:04 <glguy> yw
08:04 crunchytype joined
08:04 <ccapndave> Haskell is awesome but confusing :)
08:06 oish joined
08:06 <dfordivam> glguy:Yeah right..
08:08 mjora7 joined
08:08 maybefbi joined
08:09 augur joined
08:13 louispan joined
08:14 <dfordivam> Does rec block have known limitations, which causes it to unable to infer type of polymorphic functions defined in a let block inside rec block..
08:16 tromp joined
08:17 raichoo joined
08:20 acidjnk22 joined
08:22 hazyPurple joined
08:22 srbaker__ joined
08:27 Kuros` joined
08:28 dm3 joined
08:29 sproingie joined
08:29 sproingie joined
08:31 lep-delete joined
08:31 srbaker__ joined
08:31 oleksiyp joined
08:34 takle joined
08:37 grumble joined
08:38 connrs joined
08:39 pranitbauva1997 joined
08:39 montag451_ joined
08:40 albertus1 joined
08:41 <[exa]> Mhm guys.
08:42 <[exa]> Let's say I'd like to do simple mathematics, like e.g. write a+b*c, and I'd want the + and * operators have a side effect, for example logging.
08:43 paolino joined
08:43 blym joined
08:43 <[exa]> One obvious possibility is to break stuff into: do { tmp <- mult b c ; add a tmp }
08:43 <[exa]> but having the original syntax around would be a lot cooler.
08:44 oleksiyp joined
08:45 buttbutter joined
08:45 <sophiag> [exa]: i'm not sure what you mean by logging (like the writer monad?) but you can easily just override those operators to write to an IORef or whatever you want
08:47 <[exa]> sophiag: logging was an example of one sane thing to do with it; general monadic behavior is the target
08:48 chrisM_1 joined
08:48 Chrism13 joined
08:48 <glguy> you can make operations that take different types, IO Int -> IO Int, instead of Int -> Int
08:48 <glguy> like template haskell does
08:49 yellowj joined
08:50 takle joined
08:50 Gurkenglas joined
08:51 <[exa]> so (+),(*) would be of type m a->m a->m a and I'd somehow lift the incoming values to monad?
08:51 xtreak joined
08:51 <[exa]> yeah that would make sense I guess
08:52 tomphp joined
08:53 ompaul joined
08:54 dm3 joined
08:54 eklavya joined
08:55 bjz joined
08:56 jgertm joined
08:57 marr joined
08:58 connrs joined
08:59 zeroed joined
08:59 zeroed joined
08:59 SlashLife joined
08:59 bjz joined
09:00 systadmin joined
09:01 gmcabrita joined
09:01 insitu joined
09:02 dejanr joined
09:03 osa1 joined
09:05 systadmi1 joined
09:06 oleksiyp joined
09:09 meba joined
09:10 sz0 joined
09:11 <rightfold> I believe IO a has a Monoid instance when a has a Monoid instance
09:11 <rightfold> You can add the same for Semiring, then you can use + and * from Semiring
09:12 <rightfold> Although commutativity is hard with side effects
09:12 montik joined
09:13 <Taneb> rightfold, that's true of any applicative functor
09:13 <rightfold> If + adds actions that log it's probably not commutative anymore
09:15 thc202 joined
09:15 cloudhead joined
09:16 richi235 joined
09:17 filterfish joined
09:17 dni_ joined
09:18 filterfish joined
09:18 mmn80 joined
09:20 hjklhjklhjkl joined
09:22 matrium joined
09:22 hazyPurple joined
09:24 Nicke joined
09:24 <matrium> hi, is there an infix mconcat? something like <?> = lift2A (<>)
09:24 <mauke> :t mconcat
09:24 <lambdabot> Monoid a => [a] -> a
09:25 <Gurkenglas> :t liftA2 (<>)
09:25 <lambdabot> (Monoid c, Applicative f) => f c -> f c -> f c
09:25 <Gurkenglas> matrium, if you would be using it a lot perhaps you want WriterT
09:26 Levex joined
09:27 <matrium> I use it alot for parser combination. e.g. "(liftA2 (<>) (pack <$> many (pnChars <|> char '.')) (singleton <$> pnChars)"
09:28 <matrium> "parse and concat two text chunks"
09:29 <matrium> I thought there is maybe a well known abstraction for that
09:29 <matrium> with a fancy infix operator :-)
09:29 <cocreature> matrium: if you use that a lot just make your own infix operator :)
09:29 dm3 joined
09:30 sproingie joined
09:31 catsup joined
09:32 connrs joined
09:32 isBEKaml joined
09:32 catsup joined
09:33 robotroll joined
09:39 Wuzzy joined
09:40 oisdk joined
09:40 fotonzade joined
09:41 tomphp joined
09:47 connrs joined
09:49 epsilonhalbe joined
09:50 splanch joined
09:51 jer1 joined
09:52 zeroed joined
09:54 Yuras joined
09:55 zero_byte joined
09:57 rockfordal joined
09:57 splanch joined
09:58 freusque joined
09:58 splanch_ joined
10:03 magicman joined
10:03 brynedwards joined
10:03 xtreak joined
10:05 zariuq joined
10:07 NyanPasu joined
10:08 netheranthem joined
10:08 takle joined
10:18 govg joined
10:18 tromp joined
10:18 hasky joined
10:18 <hasky> okk
10:19 dfordivam joined
10:19 <hasky> i've learned SML, is Haskell still worth learning
10:20 <mauke> yes
10:24 filterfish joined
10:25 kritzcreek joined
10:25 <kritzcreek> how do I read a file as ByteString, but with the handle in Text rather than in BinaryMode?
10:26 ilyaigpetrov joined
10:27 oisdk joined
10:27 Wizek joined
10:27 Wizek__ joined
10:28 <cocreature> kritzcreek: try combining withFile to get a Handle, hSetBinaryMode False and “hGetContets” to read from the handle
10:28 <kritzcreek> that'll be lazy though right?
10:28 <kritzcreek> it probably doesn't matter. Thanks I'll go for that
10:31 <cocreature> kritzcreek: hGetContents for strict bytestrings is strict iirc
10:31 <sophiag> Cale: i'm listening to Conal on the Haskell Cast and he says unAmb was inspired by Amb in Lisp. it's the same technique of backtracking search, but it's deterministic since the values have to be equal and so it only takes the first one that returns and avoids hanging or stack overflows
10:31 <cocreature> it pretty much has to be
10:32 t7 joined
10:32 <rightfold> cocreature: the only laziness it could do is defer reading the entire bytestring until you process any part of the bytestring
10:32 alexbiehl joined
10:33 darlan joined
10:33 <rightfold> If any part of a strict ByteString is evaluated, all other parts are too
10:34 <kritzcreek> Oh no I think I understand now why the default readFile doesn't use hGetContents, it reads the filesize of the handle to avoid chunking
10:34 reptar_ joined
10:34 <cocreature> rightfold: right but not only does that bring the usual problems accompanying lazy IO it also doesn’t have any benefits in most situations
10:34 <cocreature> so that would be a really silly implementation :)
10:34 <rightfold> Indeed 😸
10:38 akr[m] joined
10:38 Levex joined
10:40 geekosaur joined
10:41 Itkovian joined
10:41 entuland joined
10:43 <entuland> hello everybody, I've installed the core package for haskell on win10, the instructions here: https://www.haskell.org/platform/ tell me to add some lines regarding msys and mingw to my config file, in particular extra-prog-path
10:43 <entuland> but extra-prog-path is already there in my config file, with a different value
10:43 <entuland> should I merge them somehow or add a new extra-prog-path line?
10:46 hazyPurple joined
10:46 nuclx joined
10:49 Yuras joined
10:49 mizu_no_oto_work joined
10:49 <reptar_> is it possible to get this result without sorting the list twice? http://lpaste.net/6416348323208232960
10:50 <reptar_> i want to compare on (angle low) if it's not equal and snd if it is
10:50 oisdk joined
10:50 <reptar_> if that makes sense
10:53 blym_ joined
10:54 twanvl joined
10:54 Nithinsingh joined
10:54 <kritzcreek> cocreature: 🙏 Thank you very much
10:54 <kritzcreek> It's not pretty but it works :)
10:54 <alexbiehl> reptar_: compare gives you an Ordering, and Ordering is a Monoid: try something like this: (compare `on` (angle low) <> compare `on` (snd low))
10:55 <reptar_> alexbiehl: oooh, thanks :)
10:55 <cocreature> kritzcreek: just wrap it up in a “readBinaryTextFile” function and your code looks nice again :)
10:56 <akr[m]> Hello, any idea if I can write to a Brick.BChan (https://hackage.haskell.org/package/brick-0.17.2/docs/Brick-BChan.html) from a different thread? What I'd like to do is write a TCP client application which listens for TCP input and parses them to events, then forwards them to the Brick UI
10:56 <akr[m]> so I'm fairly sure I should use 2 threads… right?
10:56 <akr[m]> one for listening for TCP input and the other for running the Brick UI
10:56 <kritzcreek> cocreature: yeah no worry it's almost pretty next to the insane invocation to decode a strict utf8 bytestring into text
10:57 <cocreature> kritzcreek: huh? you can just use “decodeUtf8” for that
10:57 <kritzcreek> TL.toStrict . decodeUtf8 . BSL.fromStrict
10:57 <kritzcreek> nope
10:57 <cocreature> you can
10:57 <cocreature> just import the right one
10:58 <kritzcreek> argh
10:58 <cocreature> e.g. Data.Text.Encoding instead of Data.Text.Lazy.Encoding
10:58 <kritzcreek> you're right my import was left over in lazy
10:58 <kritzcreek> Maybe I shouldn't write code today O.o
10:59 <cocreature> if people stopped writing code when they make a mistake nobody would ever write code :)
10:59 danvet joined
11:01 <entuland> how should I merge these two lines together? one was in my config file for starters, the other should be added as per the haskell installation instructions: -- extra-prog-path: C:\Users\user\AppData\Roaming\cabal\bin -- extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\mingw\include
11:02 trolling joined
11:02 blym_ joined
11:02 <entuland> the latter should actually be extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin
11:03 mda1 joined
11:03 <entuland> i can't find any indication whether a duplicate key would be okay or whether I should join the values with a comma or a space or whatever
11:06 Gloomy joined
11:06 systadmin joined
11:06 nilof joined
11:07 prophile joined
11:08 nakal joined
11:10 <cocreature> entuland: according to https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-field-extra-prog-path they have to be newline or comma separated
11:11 <entuland> uhm... I wonder how I didn't manage to find that doc... I'm pretty good at googling normally...
11:11 <entuland> thanks a lot cocreature
11:11 <cocreature> np
11:14 robotroll joined
11:16 mohsen_ joined
11:16 sampuka joined
11:17 <akr[m]> anyone knows if I can write into a Brick.BChan from a different thread?
11:17 blym_ joined
11:17 <akr[m]> I mean, idk how to use it otherwise :)
11:18 <cocreature> akr[m]: it looks like it’s just a wrapper around TBQueue so that should definitely work
11:18 <akr[m]> cocreature: ah great, thank you
11:20 modlin joined
11:20 descender joined
11:21 hazyPurple joined
11:22 conal joined
11:22 buttbutter joined
11:23 <reptar_> alexbiehl: <> is not in scope, where does it come from? tried hoogle, but the results didn't make sense
11:23 <alexbiehl> reptar_: try importing Data.Monoid
11:23 xtreak joined
11:23 <reptar_> thanks
11:26 ziocroc2 joined
11:27 treaki joined
11:28 soLucien joined
11:30 flatmap13 joined
11:30 joe9 joined
11:31 sproingie joined
11:31 oisdk joined
11:32 <reptar_> alexbiehl: https://pastebin.com/QA3yVAsF
11:35 sdothum joined
11:35 Itkovian joined
11:37 reptar_ joined
11:40 <kritzcreek> cocreature: seems not to be working unfortunately :(
11:41 <kritzcreek> the ByteString still contains \r\n
11:42 <cocreature> kritzcreek: can you show us the code?
11:44 <cocreature> kritzcreek: also are you on windows? afaik text mode has no effect on linux and macos even if you read files with dos line endings
11:44 <kritzcreek> yes I am ^^ that's why I'm doing it in the first palce
11:44 <kritzcreek> I have no trouble on linux
11:45 <kritzcreek> http://lpaste.net/355288
11:45 <kritzcreek> I get the same if I explicitly set `hSetNewlineMode h universalNewlineMode `
11:46 <ollieh[m]> Anyone know why I might be getting these errors when trying to build the tensorflow-ops library in https://github.com/tensorflow/haskell ? http://lpaste.net/355289
11:48 miklcct joined
11:49 <cocreature> kritzcreek: sorry not sure what’s going on here
11:49 <kritzcreek> cocreature: no problem :) thanks a lot for your help so far, I had expected that to work it looked promising :)
11:50 <alexbiehl> reptar_ try: sortBy (\x y -> comparing (angle low) x y <> comparing snd x y)
11:51 fizruk joined
11:52 <cocreature> kritzcreek: I guess just reading the file and then search&replacing \r\n is probably the easiest solution. alternatively you can read it line by line and fix the line endings in each step
11:53 theelous3 joined
11:54 RegEchse joined
11:58 jgertm joined
12:01 implementation joined
12:01 implementation joined
12:02 nirvinm joined
12:03 tromp joined
12:04 mr_sm1th joined
12:04 tremon joined
12:04 fizruk joined
12:04 Itkovian joined
12:06 <jchia_1> Lens question. If I have a function 'batchTransform :: Traversable t => t Int -> t Int' that returns the same number of output items as input items, how can I use lens to apply it to all the odd items in a list with only one call to batchTransform? E.g. if batchTransform multiplies each item by 2, I want to get [2, 2, 6, 4] from [1, 2, 3, 4]. The point is that that batchTransform is some kind of batch lookup and I want to minimize the n
12:06 <jchia_1> umber of calls to it. Without this requirement, I would simply be using fmap.
12:07 eacameron joined
12:13 ragepandemic joined
12:13 nut joined
12:14 <nut> how to serve yesod website over https
12:14 <nut> instead of http
12:14 Gloomy joined
12:14 <lyxia> jchia_1: partsOf looks relevant. I can't find a lens for filtering though...
12:15 <entuland> any advice for some simple, interesting program to try and implement with haskell when starting to learn it?
12:15 jgertm joined
12:15 <entuland> (simple is relative, I have 22 years experience in coding, just out of ideas :P )
12:15 <jchia_1> lyxia: Is 'filtered odd' relevant?
12:16 mrkgnao joined
12:16 binaryplease joined
12:16 <lyxia> jchia_1: yes! I was looking for that one
12:19 <jchia_1> lyxia: Thanks, let me see if I can combine partsOf with filtered odd to get what I want.
12:20 <cocreature> > [1,2,3,4] & partsOf (traverse . filtered odd) %~ map (*2)
12:20 <lambdabot> [2,2,6,4]
12:20 <cocreature> ^ jchia_1
12:20 nut left
12:21 <jchia_1> cocreature: Great, thanks
12:21 <cocreature> at some point I was planning to look up how “partsOf” is implemented but I’m still too scared to take a look
12:26 blym_ joined
12:27 austinkeeley joined
12:28 austinkeeley joined
12:30 SpinTensor joined
12:30 systadmin joined
12:31 dfordivam joined
12:35 srbaker___ joined
12:35 SpinTensor joined
12:38 ubsan_ joined
12:39 sepp2k joined
12:39 hive-mind joined
12:41 mjo joined
12:41 zeroed joined
12:43 dddddd joined
12:43 <Gurkenglas> jchia_1, maybe you want to implement batchTransform as "Traversal' s Int -> s -> s" - then you could pass "traverse . filtered odd" to it
12:43 tromp joined
12:44 <Gurkenglas> "Traversal s t Int Int -> s -> t", that is :P
12:45 Mon_Ouie joined
12:46 <Gurkenglas> Or perhaps just "Int -> f Int" with whatever f you were going to pass to that traversal
12:47 drninjabatman joined
12:48 geekosaur joined
12:49 <drninjabatman> hey, I am trying to convince gchi to `:kind! forall x . C x => F x` which has kind a lifted datatype. But it looks like I can only use Type kinded stuff on the right of `=>`. Is there a way to get around that?
12:50 <Gurkenglas> entuland, command-line hangman or 2048 or tetris for example
12:51 <entuland> Gurkenglas, thanks for the advices
12:52 <entuland> I wonder how complex could it be to do desktop programs with Haskell
12:52 Shatnerz joined
12:56 ziyourenxiang joined
12:57 <Gurkenglas> A straightforward gruffy way would be to use a library that provides bindings for your favorite gui library from another language
12:57 Itkovian joined
12:57 gnull joined
12:58 ziyourenxiang joined
12:58 Noldorin joined
12:59 ziyourenxiang joined
12:59 fosterite joined
12:59 cpennington joined
12:59 SpikeMaster joined
13:00 wildlander joined
13:00 noexcept_ joined
13:00 zeroed joined
13:00 zeroed joined
13:00 ziyourenxiang joined
13:01 Argue joined
13:01 splanch joined
13:02 soniku joined
13:02 javjarfer joined
13:02 epsilonhalbe joined
13:03 splanch_ joined
13:03 <lyxia> drninjabatman: I don't think you can. Why do you need that?
13:04 <drninjabatman> lyxia: I have a type level function that I need to find out what it evaluates to under certain constraints
13:05 <entuland> Gurkenglas, isn't there a preferred, common way to create interfaces with Haskell?
13:06 <Gurkenglas> entuland, you mean a thing that automatically creates a library of bindings to a given c library? Hmm.
13:06 Itkovian joined
13:06 <entuland> Gurkenglas, it's all new to me
13:07 <entuland> I'm barely swifting through http://learnyouahaskell.com right now
13:07 <Gurkenglas> Or do you mean https://wiki.haskell.org/Foreign_Function_Interface
13:07 tromp joined
13:07 <lpaste> Hjulle pasted “Parse error when combining ImplicitParams with explicit binding” at http://lpaste.net/355292
13:08 <entuland> I'll refer to this Gurkenglas, I guess: https://wiki.haskell.org/Applications_and_libraries/GUI_libraries
13:08 hazyPurple joined
13:09 <Hjulle> Same problem with let bindings:
13:09 <Hjulle> > let a = 1; ?b = 2 in 1
13:09 <lambdabot> <hint>:1:12: error: Parse error in pattern: ?b
13:09 <Hjulle> > let ?a = 1; ?b = 2 in 1
13:09 <lambdabot> 1
13:09 <lyxia> drninjabatman: typeRep (Proxy :: forall x. (x ~ 2) => Proxy (F x)) ... maybe? This works because there are only equality constraints though...
13:09 ralu joined
13:10 <lyxia> drninjabatman: Can you give more context about what you are actually trying to do
13:11 <javjarfer> edwardk, hi! Are you available?
13:11 <lyxia> Hjulle: implicit and explicit variables must be bound in different groups
13:12 reptar_ joined
13:12 <Hjulle> lyxia: Aha, thanks. How do you do that with where bindings?
13:13 Itkovian joined
13:13 <lyxia> you don't. "You may not mix implicit-parameter bindings with ordinary bindings in a single let expression; use two nested lets instead. (In the case of where you are stuck, since you can’t nest where clauses.)" https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#implicit-parameter-bindings
13:14 srbaker___ joined
13:14 <Hjulle> Ok :(
13:16 <drninjabatman> lyxia that is actually what I did, could I interest you in aswering my stackoverflow question? http://stackoverflow.com/questions/43831769/using-a-a-lifted-data-type-on-the-right-of-in-ghci
13:17 cyborg-one joined
13:18 <Gurkenglas> javjarfer, the faux-pas of asking to ask combined with the lèse-majesté of pinging ekmett! *swoons*
13:18 <drninjabatman> actually lyxia instead of using Typeable I used `:t Proxy :: ...` but its essentially the same concept
13:19 be5invis joined
13:20 mekeor joined
13:20 <javjarfer> Gurkenglas, it was to return to a previous conversation
13:26 AX3L joined
13:26 bydo joined
13:28 pavonia joined
13:30 pie_ joined
13:31 Itkovian joined
13:31 <lyxia> drninjabatman: Oh, :t works indeed. I'll let you answer your question.
13:32 sproingie joined
13:32 sproingie joined
13:34 Qui_Sum1 joined
13:35 blym_ joined
13:37 biglama joined
13:38 kuribas joined
13:38 eacameron joined
13:39 mohsen_ joined
13:39 pie_ joined
13:40 systadmin joined
13:42 bennofs joined
13:46 fosterite joined
13:47 <drninjabatman> Why does this `:t Proxy :: forall x y . (F x ~ y, 3 ~ y) => Proxy y` and this `:t Proxy :: forall x y . (3 ~ y, F x ~ y) => Proxy y` throw an error about x0?
13:48 crave joined
13:50 thunderrd joined
13:51 crunchytype joined
13:52 <lyxia> x is ambiguous
13:53 codesoup joined
13:54 <drninjabatman> how so? lyxia
13:55 Guest78343 joined
13:55 javjarfer_ joined
13:56 dm3 joined
13:56 <lyxia> drninjabatman: if you know (F x), you don't necessarily know x, because F may not be injective.
13:56 <ClaudiusMaximus> you could have F Int ~ 3 and F Bool ~ 3 for example
13:57 crunchytype joined
13:58 <drninjabatman> so defining F as `type Family F x = r | r -> x` should resolve the problem?
13:58 <lyxia> only if F is actually injective
13:58 <drninjabatman> (didn't work)
13:58 <drninjabatman> it is
14:00 <lyxia> How did it not work
14:01 <drninjabatman> lyxia: I am getting the same behavior
14:02 FreeBirdLjj joined
14:02 <drninjabatman> lyxia: https://gist.github.com/a064eb4acf99c7192254b855d34f8b56
14:03 <lyxia> drninjabatman: there is no x such that F x ~ 3
14:04 <drninjabatman> lyxia: aah yes
14:04 <lyxia> it actually works on my side either way
14:05 <lyxia> make sure you reloaded your file
14:05 modlin joined
14:08 medical joined
14:09 ahjulf joined
14:13 araujo joined
14:13 enitiz joined
14:14 richi238 joined
14:14 AX3L joined
14:20 systadmi1 joined
14:20 xtreak joined
14:21 acidjnk22 joined
14:23 refold joined
14:26 <Hjulle> Can hoogle search for instances of a class?
14:28 Bob8989|3 joined
14:28 Bob89893 joined
14:30 Gloomy joined
14:30 flatstuff joined
14:33 jmcarthur joined
14:34 _sg joined
14:34 xcmw joined
14:35 raatiniemi joined
14:36 {emptyset} joined
14:38 eklavya joined
14:38 wonko7 joined
14:38 pierrot joined
14:40 FreeBirdLjj joined
14:40 <Gurkenglas> @instances Alternative
14:40 <lambdabot> Alt f, Either e, IO, Maybe, Proxy, Seq.Seq, []
14:44 ckubrak joined
14:46 modlin joined
14:52 dm3 joined
14:52 crunchytype joined
14:52 AX3L joined
14:53 yellowj joined
14:53 roconnor_ joined
14:58 mrkgnao joined
14:58 simukis joined
14:59 bennofs joined
15:03 pierrot joined
15:03 binaryplease joined
15:05 zeroed joined
15:05 zeroed joined
15:05 cyborg-one joined
15:05 javjarfer joined
15:07 deank joined
15:10 ystael joined
15:10 sibi joined
15:10 javjarfer_ joined
15:11 Goplat joined
15:11 e14 joined
15:14 systadmin joined
15:14 xcmw joined
15:17 fre joined
15:17 arcsin joined
15:18 sepp2k joined
15:18 safe joined
15:18 tromp joined
15:19 jer1 joined
15:23 hackebeilchen joined
15:24 Welkin joined
15:24 javjarfer_ joined
15:25 Khisanth joined
15:32 sepp2k joined
15:33 sproingie joined
15:33 trism joined
15:33 bollu joined
15:34 alx741 joined
15:34 <bollu> this is possibly silly, but, well, is there an implementation of python's standard library stuff for lists and strings in Haskell? examples of things being "".join(<stuff>)
15:34 <bollu> the pure functions that exist on python lists
15:34 <bollu> find, split, etc
15:37 <cocreature> bollu: I don’t think there is one with the same naming conventions but the functions exist, partially in base, partially in other libraries (e.g. there is a “split” library), join is called intercalate, find is called elemIndex, …
15:37 mbw joined
15:37 Deide joined
15:37 urodna joined
15:37 insitu joined
15:38 afarmer joined
15:38 dunx joined
15:39 <mbw> I have an expression like "mkFun [2,4,3] $ \[i,j,k] -> (i+j)^k", where the list [i,j,k] is guaranteed to consist of three elements. How can I avoid the warning about non-exhaustive pattern matches?
15:40 <mbw> Besides matching against wildcard patterns, that would become annoying quickly I think.
15:40 <Athas> Turn it into a let-pattern, maybe?
15:40 <Athas> I don't think those come with warnings.
15:41 MDA2 joined
15:41 <bollu> cocreature: yeah, I know of intercalate, did not know of `elemIndex`
15:41 <bollu> interesting
15:41 <mrkgnao> mbw: any reason why a tuple wouldn't work?
15:42 <mbw> mrkgnao: I am using the hTensor library, which uses this convention.
15:42 Boomerang joined
15:43 hackebeilchen joined
15:43 <mbw> Athas: You mean just use a "worker function" instead of an anonymous one?
15:43 <mbw> Could you somehow make irrefutable patterns work maybe?
15:43 <Athas> mbw: yes.
15:45 pera joined
15:45 <lyxia> for some reason I get no warning with a partial lambda
15:45 <glguy> making the pattern irrefutable would remove the warning but also change the behavior of the resulting code
15:46 <mbw> I think my usage of a "modified Weverything" is the culprit here.
15:46 <glguy> you don't get warnings about partial patterns when using syntax that only allows for single patterns
15:46 <glguy> oh, unless you turn on the warnings about uni patterns
15:46 gugah joined
15:47 <mbw> I just use Weverything with two or three specific warnings disabled.
15:47 <glguy> sounds exciting
15:47 spacecadetbrown joined
15:47 <mbw> Not because I'm a pro, just because I'm paranoid though...
15:47 <cocreature> you could probably also write a function "from3 :: [a] -> (a, a, a)" and then use \(from3 -> (i,j,k)) -> …
15:48 <cocreature> or does ghc complain about incomplete patterns for view patterns? I don’t remember
15:48 <mbw> That's an interesting idea, I'll try that out.
15:48 <lyxia> it assumes the function is total
15:48 <cocreature> you’ll need a wildcard in from3 but you need only one
15:50 <lyxia> I mean, how could (from3 -> (i, j, k)) *not* match without throwing an exception
15:50 <lyxia> so this probably counts as a complete pattern
15:51 <mbw> Getting this stuff right is difficult I assume, after all that's probably why Repa and Accelerate use these snoc lists.
15:52 <mbw> (Z:.i:.j:.k) I mean. Which isn't exactly pretty either.
15:52 <Athas> Right, those confuse me whenever I have to read or translate Accelerate code.
15:53 <Athas> It's not like keeping track of array index arithmetic is easy in the first place.
15:53 <mbw> Do you do this on a regular basis? I presumed people who use these libraries are kind of in the minority...
15:55 <Athas> Yeah, but the Accelerate examples are a great source of well-written and readable simple data-parallel programs.
15:55 <Athas> (And they have already been vetted for whether they support pretty visualisations, which is important.)
15:56 blym_ joined
15:57 WhiskyRyan joined
15:57 refold joined
15:58 <mbw> My experience with Accelerate has been underwhelming. For starters, some type errors are deferred to runtime, which is kind of a deal breaker for me. Also I can't get anything to typecheck, and the examples don't show slice usage. The latter people may presumably know from Repa, but still, the types are different and you have to get the lifting/unlifting right...
15:59 <mbw> But at least it is actively developed I guess. Ben Lippmeier stated that he doesn't have time to do work on Repa anymore.
15:59 <Athas> I also find it difficult to use, but that's hardly unusual for a Haskell library. I've been unable to find anyone who uses it, unfortunately.
16:00 mstruebing joined
16:01 <mbw> Yeah I came to that conclusion as well. I asked a question about Repa/Accelerate on Reddit https://www.reddit.com/r/haskell/comments/68pc7a/equational_reasoning_with_multidimensional_arrays/ and it wasn't of much help unfortunately. I think I even got downvoted at first
16:04 coot joined
16:04 blym_ joined
16:05 acarrico joined
16:06 robkennedy joined
16:06 <Welkin> why not use matlab/numpy instead?
16:06 <Welkin> There doesn't seem to be much support for that kind of thing in haskell
16:07 rkazak joined
16:07 Princess17b29a joined
16:08 Tene joined
16:08 systadmin joined
16:08 Noldorin joined
16:08 <mbw> Yeah I was thinking of trying to use numpy or Julia. But first of all, I would have to learn yet another language. Second of all, they're dynamically typed (with optional type annotations in Julia, though). But I just like Haskell you know? I'm kind of struggling against giving it up...
16:09 dm3 joined
16:09 <Tuplanolla> At least you get to choose the way you lose your sanity, mbw.
16:10 <Welkin> matlab/numpy/etc are just tools
16:10 <Welkin> it's not the same as building applications
16:10 <Welkin> they have industry support at least
16:10 <Welkin> also, numpy is luckily not python
16:11 <mbw> Then what's the "py" for?
16:11 <Welkin> it doesn't use python "arrays" and has all its own functions
16:11 <Welkin> it uses C arrays
16:11 <Welkin> but the syntax is python
16:12 <jcjf> wow, I never thought I'd find someone who might find Python difficult
16:12 <Cale> I'm pretty sure NumPy is a library for Python...
16:12 <jcjf> I'm sitting here as a Python enthusiast curious about Haskell...
16:12 <Welkin> python isn't difficult, it's just a crappy language
16:13 <jcjf> NumPy is a Python library that makes it easier to efficiently deal with n-dimensional arrays of numbers
16:13 meandi_2 joined
16:13 <jcjf> Welkin: depends on what your language requirements are
16:13 <mrkgnao> Maybe we could be a little more forgiving. The only language we've collectively decided to is fair game is JavaScript, after all.
16:13 <mrkgnao> ;)
16:13 <Welkin> I used to like python before I knew how bad it was after discovering haskell
16:14 <mrkgnao> s/to is/is/
16:14 <jcjf> Welkin: it's a completely different paradigm, but Haskell isn't without its weaknesses
16:14 <mrkgnao> It's okay as long as you're writing stuff that doesn't run for a long time, imo.
16:14 <mbw> I learned a little python. Having already been fluent with Fortran/C/C++ at the time, I didn't see the point in delving deeper into it, since I thought it wouldn't help me think about problems "differently", so I decided to pick up Haskell.
16:14 <Welkin> jcjf: I mostly mean api decisions in the syntax and standar libraries
16:15 <mrkgnao> Having Django give you NoneType nonsense after a server running for some time is annoying. Like a superset of -fdefer-type-errors.
16:15 <jcjf> Welkin: wow.... THAT'S the part you think sucks? The CPython interpreter internals are a disgusting mess
16:15 <mbw> Also I think as soon as you have to write something non-standard that isn't solved by calling into BLAS/LAPACK, NumPy is probably not so efficient after all.
16:15 <Tuplanolla> I first found Haskell when I grew tired of incomplete and poorly designed Scheme libraries.
16:16 <jcjf> I'm having trouble finding a use for Haskell... my full-time job isn't as a programmer so it's really hard for me to find an excuse to use it
16:16 <Welkin> I almost exclusively use haskell for web development, something that most people who don't already know haskell would never imagine it would be used for
16:16 <jcjf> Welkin: that's what I was thinking of doing!
16:16 <Welkin> it's the best web dev language I have found
16:17 <jcjf> Welkin: but there's so much cognitive overhead for a beginner
16:17 <Welkin> writing api servers with servant + persistent is super easy
16:17 <jcjf> Welkin: like for me... Yesod seems to require somehow grokking what Template Haskell is doing
16:17 <Welkin> yeah
16:17 <Welkin> yesod is a bit weird
16:17 <jcjf> servant and persistent... thanks for the tip!
16:17 <Welkin> I used it for a while when I did a lot of server-rendered web apps/sites
16:18 <Welkin> now I have moved almost entirely to client-rendering
16:18 <Welkin> so the backend is just an api server
16:18 <Welkin> I prefer this
16:18 <Welkin> yesod does have a steep learning curve indeed
16:18 <jcjf> Welkin: do you use purescript or something for front end?
16:18 <jcjf> I really hate JavaScript
16:18 <Welkin> I have used elm and regular js with react+redux
16:18 <Welkin> elm is not ready for production by any means
16:19 <Welkin> I have found that I actually enjoy js
16:19 <mbw> My first success story with Haskell was when I had a huge arithmetic expression consisting of 256 terms or so, and I had to figure out which terms could be neglected due certain symmetries and other criterions. I had tried it several times on paper, and wasn't sure if it was correct. Implementing it in Haskell was a breeze, and at the time I had only known haskell for three months or so.
16:19 <Welkin> it can be a great language if you use it right
16:19 <jcjf> Welkin: like with Flow or TypeScript? or just regular ES6?
16:19 <Welkin> I'll soon test out purescript
16:19 <Welkin> es6 with flow
16:19 <Welkin> typescript is very oop
16:19 <Welkin> I'd saty away
16:19 <Welkin> stay*
16:20 <Welkin> I can write js almost like I would write haskell (except without al lthe nice types)
16:20 <jcjf> I forgot... this is not the place to discuss mutable state :)
16:20 <Welkin> just use a decent utility library like ramda (there is also sanctuary and fantasy-land that make js more like haskell)
16:21 <Welkin> using algebraic structures in js is kind of messy though
16:22 <jcjf> anyway, I still haven't grokked monad transformers so I feel like I don't quite belong here
16:22 <Welkin> that's fine
16:22 <Welkin> using yesod taught me about monad transformers
16:22 <Welkin> they're nothing special
16:22 <mbw> jcjf: Have you read "Monad Transformers step by step"?
16:22 Lowl3v3l joined
16:22 <jcjf> googling now!
16:23 <mbw> It's what made it click for me.
16:23 <jcjf> I even stopped to teach myself category theory to try and appreciate Haskell better
16:23 <jcjf> it's just so hard to get traction and get "useful" things done as a beginner
16:23 <Athas> mbw: which kind of run-time type errors do you get in Accelerate?
16:23 WhiskyRyan joined
16:23 splanch_ joined
16:23 sproingie joined
16:23 <Welkin> jcjf: I know how you feel
16:24 <Welkin> jcjf: for me, the turning point was when I started a project with yesod and rebuilt one of my medium-sized web apps that used to be in python
16:24 <jcjf> jcjf: I was actually thinking about doing this at work
16:24 soniku joined
16:24 <jcjf> Welkin: but I would never get anyone else to ever look at that code
16:25 <Welkin> although I'd suggest starting with a blog/twitter clone made with scotty if you aren't confortable with http or web dev yet
16:25 dan_f joined
16:25 <jcjf> Welkin: I've dabbled with Flask and Express, so I get the basics
16:25 moth joined
16:26 spacecadetbrown joined
16:26 <mbw> Athas: I wrote about it in the Reddit thread I posted before, at the very bottom inside my comment.
16:26 <Welkin> yesod has a lot of "magic" which is why it's not often suggested for people new to haskell
16:26 <Welkin> too much template haskell
16:27 <jcjf> mbw: oh, I HAVE seen this step by step before
16:27 <jcjf> I actually went through it once
16:27 <jcjf> but I didn't understand the subtleties of the stack order
16:28 baldrick1 joined
16:28 <mbw> jcjf: There's a chapter about transformer stack in Real World Haskell as well, which you can read online. Also, Lambdabot has an "unmtl" command.
16:28 <mniip> 1494174292 [19:24:52] <jcjf> Welkin: but I would never get anyone else to ever look at that code
16:28 <mniip> hahaha
16:28 <Cale> jcjf: This channel is generally welcoming to beginners -- there's no specific knowledge required to belong here :)
16:29 <Athas> mbw: hm, I see. Looks like the common Haskell sin of providing faulty implementations of type classes.
16:29 <jcjf> thanks Cale!
16:29 <Athas> That has more to do with the base type class hierarchy being poor than any flaw in Accelerate. (And perhaps it's type classes in general that are flawed...)
16:30 sleffy joined
16:30 texasmynsted joined
16:30 <Cale> Learning category theory is the really slow way to learn anything about Haskell -- if you like other areas of mathematics, you might find it's a worthwhile use of time, but if you're only learning to apply it to programming, it'll take a long time to pay back any effort that you put in (but it might still be enjoyable)
16:30 alx741_ joined
16:31 iomonad joined
16:31 <mniip> I often feel like CT requires topology
16:32 <mniip> not explicitly but rather implicitly to understand the reason things are a certain way
16:32 <Cale> It's one of those things which you might be inspired to do eventually -- but it's much easier to understand all the concepts we've stolen from category theory just within Haskell, without trying to understand the more abstract versions of things.
16:32 <mbw> I think Accelerate tries to be too many things at once. We don't have a sensible multi-dimensional array implementation for *serial* execution to begin with. And Accelerate wants to be 1) parallel 2) support multiple backends 3) support arrays of arbitrary rank. This is still in the exploration phase of the design space I think.
16:32 <jcjf> mniip: totally... there's so much stuff that doesn't make sense to anyone (like me) that hasn't studied higher mathematics (I'm an engineer)
16:32 <Cale> mniip: Yeah, algebraic topology has the most natural avenues into CT
16:33 <Gurkenglas> What library should I use to write something that'll let people visit a website, enter text and get back text that depends on it?
16:33 <Cale> You shouldn't need to know a *lot* of algebraic topology
16:33 Gloomy joined
16:33 <Welkin> you can learn what you need from the typeclassopedia
16:33 <Cale> But a bunch of category theoretical definitions are inspired by corresponding notions in topology
16:33 <jcjf> like pushouts and pullbacks make no sense as terms on their own, unless you have a mental picture
16:33 <mniip> usually categorical examples include Grp and Vect - that's something I understand because I know something in those fields
16:34 <Gurkenglas> (such that the text they send back is computed by the computer that provides the website, and possibly depends on other people currently using the website)
16:34 <mniip> but as topics get more advanced it's just Top and Toph and Top.
16:34 <Welkin> Gurkenglas: are you talking about writing a web app?
16:34 <sm> Gurkenglas: ie, a trivial website ? scotty or any other web framework
16:34 <Welkin> it's not clear if you are talking about a browser extensions or a web application
16:34 flatmap13 joined
16:35 <Gurkenglas> I think web application is right
16:35 <* sm> meant to say web application
16:35 <Welkin> if you want an extremely simple web app, go for scotty
16:35 <jcjf> I remember I wanted to try and understand the CT version of Applicatives, and I couldn't see the link to Day Convolutions
16:35 <Gurkenglas> sm, that's trivial? I thought trivial websites were static html pages
16:35 <Welkin> even more bare-bones would be to use wai directly
16:35 <Welkin> but then you may need to know more about http
16:35 <jcjf> Welkin: what do you recommend for writing REST (JSON returning) APIs?
16:35 <Welkin> jcjf: https://hackage.haskell.org/package/servant
16:36 <Gurkenglas> (Ideally, there'd be an analogon to https://hackage.haskell.org/package/gloss- )
16:36 <[exa]> Hm guys. I'm trying to get a nice syntax for "simple mathematics with side effects". I'd like something like do { a <- b*c+d; return a*2 }, but so that the * and + ops have side effects, e.g. log something or so. (If you see C++ and implicit allocations, you're right)
16:36 <mniip> jcjf, studying applicatives in a purely CT setup might be a bit over your head, but it looks kinda fine in haskell
16:36 <Cale> jcjf: It might be easier to understand applicative functors as monoidal functors -- if you change the API slightly, the connection becomes clearer
16:36 <[exa]> Currently I'm at a <- pure b * pure c + pure d, with the type being computed with is both Monad and Num
16:36 <Welkin> jcjf: http://haskell-servant.readthedocs.io/en/stable/tutorial/index.html
16:37 <[exa]> Any suggestion for syntactical magic that would allow the "pure" go away?
16:37 <mniip> in order to understand day convolution you have to understand profunctor ends
16:37 <mniip> in haskell that's just 'forall'
16:37 LKoen joined
16:38 Zeldhoron joined
16:38 insitu joined
16:38 <Cale> jcjf: If instead of pure :: a -> f a, we had unit :: f () (where unit = pure ()) and instead of (<*>), we took instead pair :: f a -> f b -> f (a, b), that is, liftA2 (,)
16:38 <Cale> jcjf: Well, perhaps it's easiest if we think of it as pair :: (f a, f b) -> f (a, b)
16:39 <jcjf> Cale: I believe that's the trick I recall
16:39 <jcjf> Cale: then (,) can be repeatedly applied
16:39 <Athas> mbw: I think the Data Haskell guys are trying to come up with a design (inspired by Numpy), but I have no idea how far they are.
16:39 <Athas> I'm personally a bit disillusioned with the ability of a normal inductive-types language like Haskell to support arrays well.
16:39 fosterite joined
16:39 <Cale> Well, it's just that this lines up with the definition of a (lax) monoidal functor, where we take the "tensor product" to be the pair type constructor (,)
16:39 <Zeldhoron> i'm getting an error when i try to compile a simple hello world program, command line: "ghc-8.0.2.exe .\devtest.hs", error: "`gcc.exe' failed in phase `Assembler'. (Exit code: -1073741515)", platform: windows 10 64-bit
16:40 epsilonhalbe left
16:40 <sm> Zeldhoron: tried googling for the error message ?
16:40 <mniip> Zeldhoron, wow it sounds like you're using some ancient version
16:40 <jcjf> Cale: where does the part about "having strength" become important?
16:41 <monochrom> But 8.0.2 isn't ancient.
16:41 <mniip> ah wait it saays 8.0.2 right here
16:41 <mbw> Athas: Are you referring to this? https://github.com/wellposed/numerical I talked to the guy yesterday, they're still at it and maybe they'll release an alpha this summer. I wasn't aware that Data Haskell was developing something on their own though.
16:41 <Zeldhoron> tried googling, found nothing
16:41 takle joined
16:41 <[exa]> Zeldhoron: can you get the output of the failed gcc? anyway the exitcode itself seems bogus, I suspect something microsoftish
16:42 <Zeldhoron> [1 of 1] Compiling Main ( devtest.hs, devtest.o ) `gcc.exe' failed in phase `Assembler'. (Exit code: -1073741515)
16:42 e14 joined
16:42 <Zeldhoron> that's all i get
16:42 oisdk joined
16:42 <geekosaur> how did you install ghc?
16:42 sssilver joined
16:42 <Zeldhoron> the web installer
16:42 sampuka joined
16:42 <sm> Zeldhoron: I found this one: https://github.com/commercialhaskell/stack/issues/2998
16:42 michaelw joined
16:42 <Athas> mbw: I don't know the details.
16:43 <Zeldhoron> my stack works tho, i've already installed some packages to setup atom with haskell
16:44 <Athas> mbw: which algorithms would you like to implement with Accelerate/Repa?
16:44 sssilver joined
16:44 gawen joined
16:45 <sm> Zeldhoron: short story, you need this 4/15 update of GHC for windows 10: https://mail.haskell.org/pipermail/ghc-devs/2017-April/014131.html
16:45 <geekosaur> Zeldhoron, this is probably the win10 creators update breakage, you need to use https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-unknown-mingw32-win10.tar.xz
16:45 <geekosaur> right, that
16:45 <Cale> jcjf: That's just something about Haskell monads which you generally don't get for free in other categories. In Haskell, we can define strength :: (Monad m) => (a, m b) -> m (a,b) -- and that works for any monad. (In fact, this is sequence for the pair type.)
16:46 <Zeldhoron> ah nice, thanks guys :D
16:46 <geekosaur> I thought they were going to update the web page but it doesnt seem to have happened yet
16:47 <mbw> Athas: I was giving it a shot with some simple quantum chemistry stuff, which is mainly linear algebra really. And I did get things to work using Repa, had to do some convert-fu to do an eigen decomposition though. All really for prototyping purposes only. Unfortunately, as soon as you need something non-standard, like exploit symmetry properties of matrices for instance, it all breaks down. Now I'm trying
16:47 <mbw> out hmatrix/hTensor, which are not bad.
16:47 sssilver joined
16:48 <Athas> Ow, yeah, symmetry properties are tricky in a functional parallel array setting.
16:48 <carter> mbw: data Haskell is its own thing
16:48 <Gurkenglas> http://lpaste.net/1738718579508903936 from Emacs's M-x shell on Windows
16:48 <monochrom> mbw: The other day I ran into http://hackage.haskell.org/package/numeric-quest . But I haven't tried it or benchmarked it.
16:49 <carter> I actually think imperative algorithms and nested array parallelism are under used in Haskell array lib
16:49 <Athas> Does any Haskell library support nested parallelism?
16:49 <akr[m]> Hello, does anyone know if I can read from a IO Handle returned by Network.connect to in one thread and write into it on another?
16:49 <Athas> Not many languages or libraries support it outside Haskell.
16:49 oisdk joined
16:50 takle joined
16:50 <carter> Nested parallel stuff is also known as recursion:)
16:50 <carter> Plus work stealing
16:50 <EvanR> akr[m]: yes you can
16:50 <monochrom> Do "(x `par` y) `par` (a `par` b)" and "forkIO (moar forkIO)" count?
16:50 <Cale> carter: I think Athas is referring to nested data parallelism?
16:50 <Gurkenglas> Doing the same with the "new-template" template works
16:50 <mbw> monochrom: I think I had a look at that last year or so. Sadly, it seems to be abandon-ware and from what read it's "yet another fancy EDSL". They did have some nice ideas though.
16:51 <monochrom> Ah.
16:51 <carter> Cale:yes. But that's just parallel recursion afaik
16:51 <akr[m]> EvanR: great thank you… how do you find out these sorts of things, by the way? Do you just need to know about the underlying GHC implementation of Handles, the network library, or something else completely?
16:51 <EvanR> knowing about Handles is a good idea yes
16:51 <EvanR> thats a GHC implementation detail
16:52 <Athas> carter: well, there is nothing hard about evaluating nested data parallelism, but it is bloody hard to execute it efficiently.
16:52 <Athas> In Haskell-land, Data-Parallel Haskell is the only effort I know of, and that essentially broke under the difficulty.
16:52 <EvanR> how do you find out, you can read the GHC manual or i reckon most people ask on IRC ;)
16:52 <akr[m]> EvanR: I see, thanks again :)
16:54 <Cale> carter: It's not super-simple at the type level. A parallel array of parallel arrays is implemented by storing a single array with an array of indices at which the subarrays start and their lengths
16:54 tristanp joined
16:54 <carter> Yes I know.
16:55 <carter> I'm saying that in many cases recursive decomposition is simpler to do.
16:56 <carter> Granted it's also top down vs bottom up
16:57 <Athas> Usually recursive decomposition ends up with nested data parallelism, doesn't it?
16:57 <Athas> Or do you mean manual flattening?
16:57 connrs joined
16:59 oberstein joined
17:00 kamyar joined
17:00 <kamyar> hello guys!
17:00 <kamyar> My question is somewhat long
17:00 <kamyar> In imperative languages we have something like Object Lifecycle Management
17:01 mkoenig joined
17:01 <Cale> The main snag that the DPH effort hit as I recall wasn't actually in the flattening transformation (though I think that did result in data families and the new generics system) -- but in getting stream fusion or something like it to work on the output of the vectorisation transformation.
17:01 <kamyar> It consist any type of object including connections to databases
17:01 e14 joined
17:01 <kamyar> Q1: Do we have to care about same thing here in Haskell? DO I have to close/dispose some resources?
17:02 <kamyar> Q2: How can I manage connection lifecycles, e.g. redis connections? Do I have to 'unredis' for example?
17:02 <Cale> kamyar: It's common in such cases to use a pattern which is captured by bracket
17:02 <Cale> :t bracket
17:02 <lambdabot> IO a -> (a -> IO b) -> (a -> IO c) -> IO c
17:02 <EvanR> if you want to connect, use the resouce, then disconnect each time, then its easy with bracket
17:03 <Cale> bracket takes an action for initialising a resource, a function which can be used to finalise it
17:03 <Cale> and then a function specifying what action should be performed with that resource
17:03 <kamyar> You mean something like Context Managers in Python?
17:04 <Cale> and it puts them together in the natural way: the initialiser will be run first, then the action you gave, and then the finaliser
17:04 <Athas> Cale: oh yeah, doing anything with the result of a flattener is a nightmare, too.
17:04 meoblast001 joined
17:04 <Athas> But they would eventually have encountered performance problems with flattening too. It's not exactly known for its great speed.
17:04 <kamyar> Can u give me a sample for redis (hedis)?
17:05 JoshS joined
17:07 doomlord joined
17:07 <Cale> kamyar: If you can tell me what you want to do so far as cleaning up the connections... I've never used the library and I don't see a 'disconnect'
17:07 <kamyar> Cale: It has 'unredis' that means disconnect.
17:07 <kamyar> Cale: For example set or get something
17:08 blym_ joined
17:08 <Cale> I don't think that's right
17:08 <Cale> unRedis just unpacks a Redis action into the underlying ReaderT
17:08 <kamyar> Cale: I am not sure.
17:09 <kamyar> Cale: I have no clues
17:09 zariuq joined
17:09 <Cale> It does have this quit action, but that's in the redis monad itself. I suppose that's fine. We could write a thing that makes sure that happens.
17:09 treehaqr joined
17:09 Elish joined
17:10 <Gurkenglas> Doing this https://github.com/cydparser/demo-emacs-haskell/blob/master/demo.org#Jump to the second S.get in the Example.hs of the "scotty-hspec-wai" lands me at System.Console.CmdArgs.GetOpt
17:10 meoblast001 joined
17:11 soLucien joined
17:11 <Cale> Something like... withRedis ci x = do conn <- connect ci; runRedis conn (do v <- x; quit; return v)
17:12 <Cale> Maybe that should be checkedConnect
17:12 meba joined
17:13 insitu joined
17:13 <Cale> However I think you're meant to create a connection and then reuse it, more often than not. It's a whole connection pool you're getting there.
17:13 <kamyar> Cale: Do we have to use quit in this special case? Note that hedis atuomatically creates connection pool
17:13 splanch joined
17:14 <Cale> It doesn't appear that you have to, but I've never used this library
17:14 <kamyar> Cale: Yes! Exactly
17:14 {emptyset} joined
17:14 <kamyar> Cale: I am writing a service that I need great performance and concurrency
17:15 <Cale> anyway, any setup and teardown you might have to do can usually be packaged up into a function like that
17:15 FreeBirdLjj joined
17:15 <kamyar> Cale: It is critical for me to make sure any resource is close and omit any resource leak
17:16 mizu_no_oto_work joined
17:16 dm3 joined
17:17 <kamyar> Cale: Now see this link: https://hackage.haskell.org/package/persistent-postgresql-2.6.1/docs/Database-Persist-Postgresql.html
17:17 <Cale> kamyar: Yeah, I just have no idea what you're required to do by redis
17:17 <Cale> yep
17:17 <kamyar> Cale: I guess functions starting 'with' are bracket pattern. Yes?
17:17 <Cale> yes
17:17 <kamyar> cool!
17:19 <Gurkenglas> Requesting the proper way to do "(String -> IO String) -> ActionM ()", which is a scotty page displaying a textbox in which each line is answered by the server with a line according to the function parameter
17:19 darlan joined
17:19 tromp joined
17:20 crave_ joined
17:20 systemfault joined
17:23 crave_ joined
17:24 turnage_ joined
17:25 <kamyar> PLease see this code: https://github.com/parsonsmatt/servant-persistent/blob/master/src/Api/User.hs
17:26 <kamyar> What does :> operator mean?
17:26 vonBird joined
17:26 <Welkin> kamyar: it is a type level operator
17:26 <kamyar> Welkin: What does it do here?
17:26 <Welkin> it's like list cons for the srvant api
17:26 <Welkin> er
17:26 <Gurkenglas> kamyar, http://hackage.haskell.org/package/servant-0.10/docs/Servant-API-Sub.html#t::-62-
17:27 <Welkin> it's like an append
17:27 <Welkin> or a "/"
17:27 <Welkin> in the url
17:27 romank joined
17:27 crave_ joined
17:28 <kamyar> Welkin: Thanx!
17:30 NeverDie joined
17:32 oisdk joined
17:32 horatiohb left
17:32 crave_ joined
17:32 _101010 joined
17:32 <kamyar> Please someone give me a good sample of persistent-postgresql https://hackage.haskell.org/package/persistent-postgresql-2.6.1/docs/Database-Persist-Postgresql.html
17:33 <_101010> Can someone tell me how to get the day of the week(eg: Monday) from given UTCTime?
17:33 <kamyar> I need sample with.... implementation
17:33 <Cale> _101010: You'll need to know which timezone you're in
17:34 <_101010> Why?
17:34 <Gurkenglas> For my question, 'get "/:x" $ text . f =<< param "x"' is a start but requires people to write in the address bar and reload the page for each line, and characters such as ? don't work for the input
17:34 <_101010> I have already adjusted for that.
17:34 <kamyar> I need bracket implementation for that url
17:35 darjeeling_ joined
17:35 <Cale> _101010: Because which day of the week it is can't be determined from only a UTC time
17:36 <_101010> I get that, but like May 8, 2017 is a Monday everywhere on earth right?
17:36 unyu joined
17:36 <Cale> Yeah, it's just a different day in different places
17:36 <Cale> For a given UTCTime
17:37 <_101010> So I just need that Monday given May 8, 2017
17:37 <Cale> So you can do getTimeZone
17:37 <_101010> ignoring the timezone
17:37 rfvizarra joined
17:37 okuu joined
17:37 <_101010> I am already pissed at the timezone thing as it is.
17:37 <Cale> utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
17:37 <Cale> localDay :: LocalTime -> Day
17:38 <Cale> toWeekDate :: Day -> (Integer, Int, Int)
17:38 agjacome joined
17:38 <Cale> "Convert to ISO 8601 Week Date format. First element of result is year, second week number (1-53), third day of week (1 for Monday to 7 for Sunday). Note that "Week" years are not quite the same as Gregorian years, as the first day of the year is always a Monday. The first week of a year is the first week to contain at least four days in the corresponding Gregorian year."
17:38 <_101010> Why is such a long process in Haskell honestly?
17:38 <Cale> Or you can just format the time
17:39 <_101010> Why isn't it more straightforward like other languages?
17:39 <Cale> It's always complicated
17:39 panosk joined
17:39 panoskk joined
17:39 <_101010> Where you can just time.day == Monday or something?
17:39 dunx joined
17:39 <Cale> Well, what does that mean?
17:39 <Cale> If you have a *time* only, that doesn't tell you which day it is.
17:40 <Cale> You need to know which time zone you're in to know that
17:40 <_101010> It does at least in GMT
17:40 <Cale> Well, you can pick GMT
17:40 <_101010> Not with Haskell can you?
17:40 <[exa]> If I try to bind Integer to a Num member, I'm getting fromInteger called automatically. Is there some rationale behind that?
17:41 <Cale> utc :: TimeZone
17:42 <Cale> Or you can use minutesToTimeZone or hoursToTimeZone to build a zone from scratch if you need to.
17:42 m3 joined
17:42 <Cale> That usually isn't required...
17:42 drcode joined
17:42 <Tuplanolla> They're gone, Cale.
17:43 <sm> guess they ran out of time
17:43 <nshepperd> if you have a civil time, that tells you what day it is
17:43 <Cale> Someone who obviously has not written very much software involving times
17:43 <Cale> Yeah, you need a LocalTime
17:43 <nshepperd> ie. a point on the gregorian calendar
17:43 <nshepperd> looks like LocalTime is the haskell version of that
17:43 <Cale> yep
17:44 crave_ joined
17:44 <sm> haskell's time libs are great, but is there a need for a rethought api with more user-friendly organization ?
17:45 jordan32942 joined
17:45 <jordan32942> https://ideone.com/QQS0LD
17:45 <sm> and, any projects working on that ?
17:45 <jordan32942> can anyone help me with this short program?
17:45 <Tuplanolla> We can't really have nice things until the operating system supports atomic time, sm.
17:46 kamog joined
17:50 <geekosaur> jordan32942, the main problem is that main has to be an IO something.
17:50 <geekosaur> the easiest solution is to do something with the result of f1, like print it
17:50 tomphp joined
17:50 <jordan32942> i still get the same error tho
17:50 oberstein joined
17:50 <jordan32942> Parse error in pattern: help_function
17:50 <jordan32942> Possibly caused by a missing 'do'?
17:51 crave_ joined
17:51 romank joined
17:51 shivansh joined
17:51 shivansh left
17:51 Uakh joined
17:51 Dookie14 joined
17:51 Dookie12 joined
17:52 sizeofchar joined
17:52 shayan_ joined
17:52 <geekosaur> but that error is not shown in your paste. does the paste actually match your local code? including indentation?
17:52 <Gurkenglas> Can I use scotty to have a user communicate with the server without reloading the page?
17:53 oisdk joined
17:55 <cocreature> Gurkenglas: sure
17:55 <cocreature> Gurkenglas: there is nothing special you need to do on the backend site. just make a route that exposes the information you want to provide to the user and then make an ajax request in your frontend code
17:56 crave_ joined
17:56 WhiskyRyan joined
17:56 cpennington joined
17:56 <jordan32942> oops youre right, its working with the print statement, thanks geekosaur
17:57 <Gurkenglas> cocreature, do you have a oneliner that expresses that as "(String -> IO String) -> ActionM ()", where the argument maps user lines to lines the server answers with, or something else that exemplifies the concept?
17:59 doomlord joined
17:59 bennofs joined
18:00 blym_ joined
18:00 <cocreature> Gurkenglas: something like "\f -> get "/communicate" $ do arg <- param "arg"; response <- f arg; text response" should work but from scotty’s perspective there is really no difference in a request that is send by loading a page in your browser or an ajax request
18:00 <nshepperd> Tuplanolla: we could have a library correcting system time back into TAI by downloading the leap second tables
18:00 <cocreature> so you don’t need to do anything special here
18:00 crave_ joined
18:01 <Tuplanolla> That sure is a nice solution, nshepperd.
18:02 gehmehgeh joined
18:02 <nshepperd> the correction itself would be a bit complex but once you've got the basic functions you could have first class support for TAI at least within your program
18:04 Dookie15 joined
18:05 leat joined
18:05 crave_ joined
18:06 cyborg-one joined
18:06 soLucien joined
18:07 <[exa]> OK I refined my example a bit. I got data I = Normal | MadeFromInteger which is a member of Num, all methods of Num return Normal except fromInteger, which returns MadeFromInteger. Now 5::I returns MadeFromInteger instead of typechecking failure I'd expect. Is there any documentation to that behavior?
18:08 <Gurkenglas> cocreature, so by "making an ajax request in your frontent code" you mean adding a UI element to the webpage I'm providing that will transform lines entered into these "ajax requests" and then that same element will have to receive and display the server's responses? (I'm assuming what I want to do is the basic usecase of *something* and thus trying to find the oneliner that does it)
18:08 dsfox1 joined
18:08 <Tuplanolla> How would you ensure the operating system hasn't neglected some of the corrections, nshepperd?
18:09 crave_ joined
18:11 <nshepperd> i think you would assume that the operating system is synchronized to utc
18:11 blym_ joined
18:12 zero_byte joined
18:12 crave_ joined
18:12 <cocreature> Gurkenglas: no I mean write some javascript that sends a http request to your scotty server at the point you want and with the contents you want, receive the response and then do whatever you want with that
18:13 <nshepperd> if it's not, there's probably not much you can do about it, outside of embedding an ntp client and doing your own timekeeping
18:15 AX3L joined
18:15 darjeeling_ joined
18:15 <Cale> [exa]: Yes, that's specified in the Haskell Report
18:15 <Cale> [exa]: Integer literals implicitly have fromInteger applied to them
18:15 romank joined
18:15 mada joined
18:15 <Cale> :t 5
18:15 <lambdabot> Num t => t
18:15 <Cale> ^^ that's how 5 gets to be polymorphic in the first place
18:16 <[exa]> oh so
18:16 <Gurkenglas> How can I write a webpage that commicates with the server without using javascript?
18:16 <Cale> That doesn't look like a very good instance of Num
18:16 <[exa]> thanks! I was starting to suspect some defaulting weirdness
18:16 <Gurkenglas> I mean, using it under the hood is alright, just no writing pls
18:17 crave_ joined
18:17 <Cale> Gurkenglas: Well, there's XHR and Websockets support in Reflex.
18:17 <Cale> Gurkenglas: There's also support for those things at a lower level in GHCJS
18:19 dsfox1 joined
18:19 <cocreature> there is also purescript, elm and various other ways to generate js
18:19 <nshepperd> Tuplanolla: i dunno, it might be possible to detect if the latest leap second hasn't been applied yet due to the machine being offline during it or something
18:19 <nshepperd> if there is no observed discontinuity in the system clock
18:20 romank joined
18:21 SeMas joined
18:22 crave_ joined
18:23 govg joined
18:24 sproingie joined
18:24 sproingie joined
18:25 soniku joined
18:26 crave_ joined
18:27 hackebeilchen joined
18:30 crave_ joined
18:31 connrs joined
18:32 splanch joined
18:32 soLucien joined
18:34 torstein joined
18:35 crave_ joined
18:35 <tippenein> if I run cabal test, it's missing the test dependencies. If I run cabal configure --enable-tests it's missing all the other dependencies as well. What's the deal?
18:36 <tippenein> usually I use stack, so I'm unaccustomed to this. (also, cabal build works fine)
18:36 bairyn joined
18:39 crave_ joined
18:39 mohsen_1 joined
18:41 <cocreature> tippenein: it’s been a while since I’ve done the standard cabal build dance but try "cabal install --only-dependencies --enable-tests"
18:41 Shock_ joined
18:42 chaosmasttter joined
18:42 <tippenein> Is there another dance? This one is getting tiresome
18:43 <tippenein> that fails for a different reason
18:43 crave_ joined
18:43 <cocreature> if you’re feeling adventurous, there is “cabal new-build” but you probably want to build cabal from the master branch for that since the version included in 1.24 won’t get you very far
18:44 <cocreature> tippenein: show us the error message :)
18:44 <tippenein> I'm using ghcjs with nix, and everything is working for builds, but somehow tests are barfing all over
18:44 <tippenein> it's just a "could not resolve dependencies" on reflex-dom
18:46 <cocreature> there are various reasons why dependencies can’t be resolved and the error message often contains important information for getting it to work
18:46 quobo joined
18:46 NeverDie joined
18:48 uuplusu joined
18:48 <lpaste> tippenein pasted “cabal test ” at http://lpaste.net/355296
18:48 crave_ joined
18:48 dfeuer joined
18:49 <cocreature> tippenein: your ghc is too new
18:49 <cocreature> base 4.9 is ghc 8.0 but reflex-dom requires 7.10
18:50 <cocreature> (or 7.8)
18:50 <tippenein> why would the tests use a different base than the executable?
18:51 <Lokathor> one of these days base should just match GHC's version number
18:51 <Lokathor> skip however many in between
18:51 kamyar joined
18:51 <kamyar> Hello friends!
18:51 <Lokathor> hello kamyar
18:51 <cocreature> Lokathor: or it should be upgradable :)
18:51 <cocreature> but the current state is bad
18:52 <kamyar> please help me write postgresql-persistent code
18:52 montag451__ joined
18:52 <kamyar> this is the link: https://hackage.haskell.org/package/persistent-postgresql-2.6.1/docs/Database-Persist-Postgresql.html#t:ConnectionString
18:52 <Lokathor> cocreature, if "base" reprisents, among other things, primops that the compiler inserts in place of the actual code (such as with Word/Int/etc) then making it upgradable might not make sense
18:52 <kamyar> I want my code to open a connection pool at start (initilization) and use its connections during function calls
18:53 augur joined
18:53 <kamyar> I have no clue how to call withPostgresqlPool at app initilization
18:53 <kamyar> and hold the resulting pool
18:53 <Lokathor> kamyar, okay, this sounds normal enough
18:53 <Lokathor> so there's two parts
18:53 <cocreature> tippenein: are you sure that "cabal install --only-dependencies" works? if so the only reason I can come up with is that only your test suite depends on reflex-dom
18:53 <tippenein> kamyar: this should help you https://github.com/parsonsmatt/servant-persistent/blob/master/src/Config.hs
18:53 fotonzade joined
18:53 <Lokathor> (1) you have to declare your pool setup (2) you have to give it a function to perform with that pool
18:54 <cocreature> Lokathor: yeah you definitely can’t make all of base upgradable. but you could split it and make reasonably large parts of it upgradable. at some point there were proposals for that but i think they’ve just died
18:54 <tippenein> cabal install --only-deps doesn't work
18:55 <Lokathor> cocreature, well, jumping base from 4.9 to 8.0.2 and having base's version always match GHC's version seems like it would clear a lot of confusion and make the least waves
18:55 <tippenein> which is baffling because cabal build does..
18:55 <tippenein> must not be the same as stack install where it just moves the build to a local exe dir
18:55 <kadoban> Lokathor: Now that would be nice, IMO.
18:55 tristanp joined
18:56 <cocreature> Lokathor: yeah at this point that’s definitely the most reasonable solution
18:56 <Lokathor> i personally can't think of a reason to not do that other than "i don't wanna"
18:56 <Lokathor> but i'm no haskell expert
18:57 ystael joined
18:57 <davean> Lokathor: Base isn't really quite exactly linked to GHC?
18:58 <Lokathor> davean, base doesn't have to actually change code each GHC version, but when it does it's easiest to remember the changes by GHC version, because that's what people talk about a lot more
18:59 <davean> Lokathor: Yes, but the conenction is in NEITHER direction
18:59 <davean> base is truly seperate from GHC, they're just closely connected
18:59 <Lokathor> i'm not sure what you mean by that
18:59 Destol joined
19:00 <Lokathor> i mean, as far as i know, you can't run GHC with a version of base it's not intended for. you just have to get a newer GHC if you want a newer base for some reason
19:00 <davean> Lokathor: "base" can be used by other compilers (and has been), I can use multiple versions of base even
19:00 <davean> Lokathor: ah, but you can!
19:00 <davean> it requires recompiling GHC
19:00 <Lokathor> ha
19:00 <Lokathor> then that doesn't count so much, does it
19:00 <davean> sure it does
19:00 alx741 joined
19:00 <davean> I have no idea why it wouldn't count
19:01 <kamyar> tippenein: Thnx! But there is still something I can understand here
19:01 <Lokathor> because people aren't going to recompile their compiler, they're just going to get the newer compiler if they're going to go through that much effort
19:01 torgdor joined
19:01 <davean> ... I do
19:01 <davean> the fact that most people doesn't seems entirely irrelivent
19:02 <Lokathor> uh, that's a silly statement i think
19:02 <davean> infact, if no one did it wouldn't really matter
19:02 <kadoban> davean: Would the version numbers not lining up in your very esoteric case ruin something?
19:02 <Lokathor> serving the most people at once is exactly what projects shouhld do
19:02 <davean> the fact is, they're not directly linked
19:02 <kamyar> tippenein: How can we 'hold' pool for later use?
19:02 <Lokathor> davean, but you can allow version ranges in your cabal file, so
19:02 <davean> Lokathor: No, projects should make the best tools or products they can
19:02 <kamyar> tippenein: I dont see any code for this
19:03 <cocreature> davean: but the best tool or product is not necessarily the most flexible one
19:03 <Lokathor> kamyar, going by the docs you linked, you want createPostgresqlPool
19:03 <davean> cocreature: correct
19:03 <tippenein> kamyar: https://github.com/parsonsmatt/servant-persistent/blob/master/app/Main.hs#L21-L23
19:03 <Lokathor> but if you use withPostgresqlPool instead, it'll automatically clean up the pool for you
19:04 <Lokathor> depending on your use case, you might choose to pass your entire program into withPostgresqlPool and run your entire program within a single connection pool
19:04 <kamyar> Lokathor: I know, but each time I call the function, a new pool is created! I just want to return the same
19:04 <tippenein> generally you keep your access to the pool in a Reader which all your application can access
19:04 <Lokathor> then you want withPostgresqlPool, that uses one pool the whole time that the function you pass in is running
19:05 <kamyar> Lokathor: Ok just got the key
19:05 <kamyar> tippenein: Thanx
19:05 <davean> Lokathor: basicly I see no more reason for base to be GHC version linked then mtl to be
19:05 <davean> it would be, frankly, counter productive IMO
19:05 sproingie joined
19:05 sproingie joined
19:06 <kamyar> I just have not yet get used to functional declarative pattern in which the whole program is a function and it calls others!
19:06 <c_wraith> davean: are you suggesting putting all functionality that depends on GHC internals into a different package than base?
19:06 <Lokathor> anything that requires that you *recompile the compiler itself* should be in a package called base/std/com.java/whatever that's always of a version that matches your compiler's version
19:06 <tippenein> kamyar: you'll get it.
19:06 <kamyar> So to have a, lets say singleton, variable I just have to make it in main function
19:06 <davean> c_wraith: Most of it already is really
19:07 <Lokathor> kamyar, one moment, let me write a small example
19:07 <c_wraith> davean: well, not really. Look at how many GHC.* modules are in base.
19:07 <davean> c_wraith: a lot of those aren't tied to GHC, they're just base internal modules
19:09 <c_wraith> davean: a quick scan of their contents suggests more than half of them depend on details of GHC's data layout or IO manager
19:09 <c_wraith> or runtime system as a whole
19:09 <davean> The IO manager is mostly not GHC specific
19:09 <Lokathor> kamyar, http://lpaste.net/355297 here is a very small example of how you might do it
19:10 zv joined
19:10 Intensity joined
19:10 <Lokathor> oh whoops
19:10 <davean> (actually, what parts of the IO manager are GHC specific at all these days?)
19:10 <davean> (No part I've touched)
19:10 flatmap13 joined
19:10 <kamyar> Lokathor: Great! Thnx!
19:10 <Lokathor> kamyar, there, refresh the page, i had to fix the type signature
19:11 <Lokathor> i hope that helps as a starting point. I've never actually done this particular thing before, so come back if there's more trouble :3
19:11 <davean> (uh, maybe the initial setup of handlers?)
19:11 jordan32942 joined
19:11 <davean> (The pumps aren't GHC specific at all, but their actual creation is ... sorta)
19:12 Aruro joined
19:13 <Lokathor> davean, so here's my question for you: if the version on the base package were to change more often, since you can already set version ranges in your cabal file, how does that hurt you?
19:13 <Lokathor> And as a follow up, do you understand that it would help others (perticularly newbies) to have that system of baseVersion==GHCversion?
19:13 <davean> Lokathor: its not that it "changes more often"
19:13 <davean> Lokathor: I have no idea how it would help anyone
19:13 <Gurkenglas> I've told intero to apply its suggestion to add the text package when I tried to import Data.Text, but calling "stack build" from the shell still says that I should put text into the build-depends of my .cabal file. What did I do wrong?
19:14 hackebeilchen1 joined
19:14 <davean> Lokathor: I only see problems from it
19:15 ystael joined
19:16 <Lokathor> since you're the only person who's ever even suggested recompiling GHC to work with a different version of base as a practical thing to do, i suppose perhaps you're an outlier enough that it would harm your usecase
19:16 <MarcelineVQ> davean is definetly not alone in his opinion
19:16 <tippenein> do ppl actually use cabal successfully? They must
19:16 <MarcelineVQ> there is and has for awhile been ongoing work to split up base in such a way as to reduce or remove the neccesity for ghc to be involved and allow less version bumping when smaller parts change
19:16 <davean> tippenein: whats your issue with cabal?
19:17 <glguy> tippenein: sure, lots of people only use it
19:17 <davean> Lokathor: I mean, consider if what you're supporting is base, and NOT GHC, now you've ruined the package version policy
19:17 AX3L joined
19:17 <davean> among other issues
19:18 <Lokathor> tippenein, almost everyone uses the project.cabal file format. not everyone uses the cabal program. many use the stack program (but that still uses the same project.cabal file format)
19:18 mizu_no_oto_work joined
19:18 <hpc> stack uses it because it stack calls cabal
19:18 <davean> Lokathor, tippenein: Even when you use stack, you're using cabal, stack just uses cabal for you
19:19 <Lokathor> sure but i mean *manually* using the cabal program folks :P
19:19 <tippenein> ^
19:19 <davean> tippenein: so, what issue are you having?
19:19 <Lokathor> i'm sure that i sometimes use gcc as well when a compile a haskell project, but i wouldn't call myself a direct user of gcc
19:20 <tippenein> http://lpaste.net/355296
19:20 <tippenein> cabal build works fine. everything else fails with dep issues
19:20 <tippenein> I haven't figured out how to use stack with nix, so I've been trying to get more used to cabal
19:20 <tippenein> *raw cabal*
19:20 <davean> tippenein: uh, I feel thats pretty direct in what its saying
19:20 <Aruro> tippenein: did you read cabal docks?
19:21 zeroed joined
19:21 zeroed joined
19:21 <davean> reflex-dom specificly doesn't work with the version of base you have
19:21 <tippenein> davean: but it does if I build the project
19:21 <tippenein> why is that different?
19:21 acarrico joined
19:21 <Lokathor> something you pull in as part of testing might need a lower version of reflex-dom than the version that the main binary uses
19:21 <tippenein> Aruro: are you really telling me to rtfm?
19:22 <davean> tippenein: well, you didn't conclude the configure command
19:22 <glguy> are the dependencies list ed in the tests in need of an update?
19:22 <davean> tippenein: so one has to infer what you asked for when you did the build
19:22 <Aruro> tippenein: im suggesting to look here, there is lots of stuff with nix, https://cabal.readthedocs.io/en/latest/
19:22 <davean> tippenein: one infers you already have a reflex-dom installed, and you might have a sandbox? its hard to say
19:22 <Aruro> tippenein: there is nothing wrong to rtfm, i wish people tell it to me more often
19:23 <davean> personally, I try to fully read the manual before using any software
19:23 chaosmasttter joined
19:23 <davean> cabal's isn't the best sadly
19:23 <davean> it doesn't even fully describe its own formats
19:23 viran joined
19:24 <davean> ok, actually the cabal documentation is rather bad. Bad enough I'm not sure how to make an incrimental improvement which is why I haven't submitted any patches
19:24 <MarcelineVQ> new-build has better docs, iirc
19:24 <MarcelineVQ> for the user I​ mean
19:24 <davean> MarcelineVQ: new-build is notably better at the very least
19:25 <davean> the docs still tie back into the bad base documentation though
19:25 <tippenein> ^
19:25 <viran> Hey folks, maybe you could help, I need to implement an equation solver (non-linear) and provide a step by step solution... any known methods on doing that?
19:25 <davean> the cabal docs spend a lot of time refering to cabal specific things the docs never actually describe or define for one
19:25 <tippenein> ok, so we agree, RTFM isn't useful in this case
19:25 <tippenein> Should I just switch to new-build?
19:26 <davean> IIRC the "data-files" part is particularly poorly dealt with
19:26 <jordan32942> f2 liste = ["F:" ++ a | a <- liste, '?' `elem` a]
19:26 <Aruro> people have been complaining about new build too
19:26 <davean> tippenein: one should always use new-build now IMO, but lets solve your actual problem?
19:26 <jordan32942> is there any way to do something else when ? is NOT elem of a ?
19:26 <tippenein> I don't even know what my "actual problem" is tbh
19:26 tomphp joined
19:26 <davean> tippenein: we've proposed some information you didn't include and some possible sources of the problem already
19:26 <davean> tippenein: I think we're all just waiting for your reply to those things
19:27 <Aruro> and he complained about RTFM
19:27 <Aruro> nice
19:27 Itkovian joined
19:27 gugah joined
19:27 gawen joined
19:28 <tippenein> it's within a nix-shell. none of the configure commands succeed because of missing deps. cabal build completes successfully. reflex-dom is definitely installed because my build is successful.
19:29 <davean> tippenein: yes, but we have no reason to believe the install is using the same things, which is specificly what we were talking about
19:29 tomphp joined
19:29 <tippenein> why would the install use different deps than the build?
19:30 AX3L joined
19:30 <davean> tippenein: unlike new-* theres no build plan connection here
19:30 <davean> tippenein: well, because, as I said, you didn't mention what the configure was for the build
19:30 ralu joined
19:30 <Lokathor> tippenein, i think what they're saying is that the "build" uses the executable profile, but that might not match the same deps a the "test" profile
19:31 <Aruro> tippenein: #hackage and #ghc has many people who have written cabal, perhaps they can help
19:31 <davean> or, the build plan might just be old - the install will make a new build plan as would configure
19:32 <davean> tippenein: you see the test plan isn't working in general
19:32 <Lokathor> (this is why you always use sandboxes with cabal, and just delete them and start over if anything at all goes wrong; we call this the "erlang" method of development)
19:32 <davean> and you're demanding the test plan for the install
19:32 <davean> Lokathor: how does that relate here?
19:32 <Gurkenglas> Is there a way to get intero to build and execute my project so I dont have to go to emacs's shell and do that manually?
19:33 <Aruro> we are talking about nix on top of everything, nobody knows what is in shell.nix yet.
19:33 Bassetts joined
19:33 <Lokathor> davean, you yourself just suggested that there might be an old plan in effect that's confusing things
19:33 <ezyang> Is this Cabal problem in conjunction with nix?
19:33 <davean> Lokathor: its not confusing anything
19:33 <davean> Lokathor: the plans are clearly different plans, we don't have any idea how he made the plan that build works for, we know how whe can make two non-working plans
19:33 <* ezyang> doesn't know how to debug nix problems, sorr
19:34 <davean> he's just not telling us what he actually did
19:34 Elhamer joined
19:34 <Aruro> ghcjs+nix+hell lots of stuff --> definitely cabals fault! :D
19:34 <ezyang> well, it probably is Cabal's fault...
19:35 <Lokathor> davean, and if it was/is a sandbox then you could just delete the sandbox, start from scratch, and log all the output the entire time, so we'd be able to see what's going on in the log
19:35 <davean> Lokathor: don't need the sandbox for that - he could just run configure again
19:36 <tippenein> there definitely _is_ a lot of possible points of failure here. I'v ebeen successfully using nix-build, nix-shell, and cabal build within it for weeks now, but I only recently wanted to add a test suite
19:36 Shock_ joined
19:36 <davean> tippenein: I suspect you failed in adding the test suite from what I see - do you want to paste the cabal file?
19:36 <Aruro> and shell.nix
19:38 <lpaste> tippenein revised “cabal test ”: “cabal test ” at http://lpaste.net/355296
19:39 <davean> tippenein: you know "2.*" isn't very safe, right?
19:40 other_spacecadet joined
19:40 hackebeilchen joined
19:41 tshelburne joined
19:41 <tippenein> I'm pretty comfortable with that tbh
19:41 <tippenein> that's the least of my worries atm
19:41 <mniip> fmapping in the category of natural transformations is a way to lift the fmapping to a second/third/... type argument in a bi/tri/...-functor, does a similar construct exist for other functions
19:42 <davean> Its just weird you made a "2.*" on that and no constraint on anything else
19:42 tshelburne left
19:42 <tippenein> it's thrown out anyway but I just copy-pasted from one of my other projects
19:42 <mniip> I mean, I'm writing a function that accepts an arbitrary indexed type constructor, but how can I let the user decide what argument of the constructor is the index?
19:43 <davean> tippenein: this is weird, I have to assume the lack of tasty-hspec is a nix issue
19:46 <Lokathor> so how fast is C compared to unboxed+unpacked int values?
19:47 <tippenein> davean: you might be right about that. the results of cabal test being the indicator?
19:47 blym_ joined
19:47 <davean> yes
19:48 <tippenein> package.nix is part of the environment and tasty/tastyhspec are part of that. I'll check a lil deeper within the nix-shell, but I can test that quickly
19:48 northfurr joined
19:49 <davean> tippenein: I mean, my main concern is still that you don't have a good reflex-dom in scope, but the test output shows something is deeply wrong with your available package set to begin with
19:50 <davean> never mind I'd never thouch a cabal file so poorly specified in required versions
19:50 <davean> but it isn't cabal's fault it can't find an install set, clearly the packages simply don't exist
19:50 <davean> (for your test dependencies at least)
19:50 <davean> Its no even a version issue
19:51 <tippenein> nix is the one choosing the versions
19:52 <davean> yes, which is exactly why I stopped using nix actually ...
19:52 <mniip> what edwardk module defines NT?
19:52 Levex joined
19:54 Costar joined
19:55 justanotheruser joined
19:55 <tippenein> possibly Control.Natural mniip
19:55 <mniip> thanks
19:55 sleffy joined
19:55 <tippenein> thank hoogle :D
19:56 <mniip> weird
19:56 <mniip> it isn't a kmett package
19:56 soLucien joined
19:56 viralstitch joined
19:56 bollu joined
19:58 e14 joined
19:59 mmachenry joined
20:02 cshannonn joined
20:03 fosterite joined
20:03 fosterite joined
20:04 oleksiyp joined
20:04 Itkovian joined
20:05 michaelw joined
20:06 v0latil3 joined
20:07 v0latil3 joined
20:07 entuland joined
20:08 raynold joined
20:09 mmn80 joined
20:10 blym_ joined
20:11 splanch joined
20:13 SenpaiSilver joined
20:13 raichoo joined
20:13 zeroed joined
20:14 dolio joined
20:16 JScully joined
20:16 <JScully> hi everyone, i am new to haskell
20:17 <JScully> i have a function called halfadder that returns a tuple (Bool, Bool)
20:17 <JScully> i cannot apply fst on it
20:17 <JScully> fst halfadder(a, b) gives me and error altough halfadder returns (Bool, Bool)
20:18 <lep-delete> because you apply fst to two values
20:18 <davean> JScully: so "fst halfadder(a, b)" is the incorrect syntax
20:18 <davean> JScully: you might want something like "fst $ halfadder (a, b)", or "fst . halfadder $ (a, b)" or "fst (halfadder (a, b))" or ...
20:20 <lyxia> fst halfadder (a, b) = (fst halfadder) (a, b), which is not what you want.
20:20 <JScully> ahh
20:21 poxar joined
20:21 <davean> all the things I showed are ways of reprioritizing the binding
20:21 tesan joined
20:22 eacameron joined
20:22 <JScully> still getting errors :/
20:23 fnurglewitz joined
20:23 <monochrom> Yes, usually you make multiple mistakes at once.
20:24 <JScully> https://pastebin.com/2FEhArKE
20:24 <JScully> Couldn't match expected type `Bool'
20:24 <JScully> with actual type `(Bool, Bool)'
20:24 <JScully> where is this coming from?
20:24 soLucien joined
20:24 <davean> I would suspect you're wrong about the type of halfadder?
20:24 <Tuplanolla> Does it not give you line and column numbers, JScully?
20:25 <davean> and ... infact you are not correct about it
20:25 <davean> it takes two bools, not a tuple of bools
20:25 <monochrom> I think halfadder is OK. How many parameters does test take? 2? 3?
20:25 <JScully> ahhhh
20:25 <davean> halfadder :: Bool -> Bool -> (Bool, Bool)
20:25 <Costar> you should call halfadder a b and not halfadder(a,b)
20:25 hacman joined
20:26 <monochrom> And yeah, that too.
20:26 <tesan> Hello @ Haskell programmers. I'm new to programming and had some experience with imperative oop... and when I came across Haskell I got confused. Would anyone mind telling me the key-advantage[s] of Haskell? (Whisper at me if you think this is spam'sh)
20:26 cloudhead joined
20:27 <JScully> i understand, thanks
20:27 <monochrom> The key advantage is lack of Object Obfuscation Pomposity (OOP).
20:27 poxar joined
20:27 soniku joined
20:28 <mniip> lax monoidal endofunctors? /s
20:28 <monochrom> https://www.slideshare.net/ScottWlaschin/fp-patterns-buildstufflt Especially slide 13.
20:28 <mniip> monochrom, broken link
20:29 <monochrom> Works here. Keep trying. I even have Adblock.
20:30 eschnett joined
20:30 insitu joined
20:32 splanch joined
20:33 <mniip> weird
20:33 blym_ joined
20:33 <mniip> getting ECONNREFUSED
20:34 <monochrom> That's strange. Works here for the 3rd time.
20:34 <mniip> ah good job
20:34 <mniip> site's blocked by govt
20:34 <monochrom> Eeek...
20:35 <Tuplanolla> They got sick of people not just sharing PDF files.
20:35 <tesan> monochrom: So you think OOP is a waste of resources?
20:35 <monochrom> Your government wants to fight university students' plagiarism? :)
20:35 <monochrom> Yeah, waste of natural resources.
20:36 <monochrom> Generally any indirect encoding of what you really mean is.
20:36 <JScully> phew this is though
20:37 <JScully> https://pastebin.com/1UP5pb9r
20:37 <JScully> Probable cause: `fst' is applied to too few arguments
20:37 <JScully> whats wrong with that :|
20:37 <monochrom> moar parentheses
20:38 <monochrom> halfadder cin (fst (halfadder a b))
20:39 <monochrom> In general, just because you shrink some spaces such as "a b c(d)" doesn't mean the compiler won't stretch it back to "a b c (d)"
20:39 anuxivm joined
20:39 <JScully> Couldn't match expected type `Bool' with actual type `(Bool, Bool)'
20:39 <JScully> error after error :D
20:39 <monochrom> where?
20:40 <JScully> 2:17:
20:40 <monochrom> You need to keep most updated code and error.
20:40 <monochrom> What's on 2:17?
20:40 <monochrom> You need to keep most updated code and error.
20:40 <JScully> my tuple starts there (halfadder cin (fst(halfadder a b)), False)
20:40 <JScully> https://pastebin.com/s6MD2E37
20:40 <mniip> monochrom, I must say I disagree
20:40 <mniip> OOP has its use
20:41 <JScully> oh
20:41 <JScully> i got it
20:41 <JScully> sorry
20:41 <monochrom> Yes mniip, I agree too. But minority.
20:41 <mniip> if you have a large codebase OOP is a good and easy to understand way to achieve modularity
20:42 <monochrom> I guess I am disqualified to talk about large codebase because I haven't even seen one, eh?
20:42 bollu joined
20:42 <systemfault> Assuming very experienced developers and a ton of discipline? :/
20:42 <monochrom> But I'll point to the fact that aspect oriented programming was a thing precisely because OOP got you the wrong modularity.
20:43 <systemfault> The large OOP codebases I've seen become entangled mess of mutable state.
20:43 eSVG joined
20:44 <monochrom> So, I don't have first-hand evidence to support my disagreement, but I can always pit one camp of large codebase programmers against another camp.
20:44 roconnor_ joined
20:44 <JScully> it works :>
20:44 <JScully> thanks
20:45 <monochrom> congrats
20:45 <Welkin> mniip: oop is anything but easy to understand
20:45 <Welkin> it's like a practical joke
20:45 <Tuplanolla> I don't have a strong opinion, but I've noticed that I certainly can't build sensible object-oriented architectures, tesan.
20:46 <tesan> OOP seems very easy for me to understand. Atleas as far I have seen... even with operator overloading.
20:46 <Welkin> what counts as a "large codebase"?
20:46 <Welkin> it depends on the language, of course
20:46 <Welkin> the rails codebase I work on is terrible
20:46 <Welkin> it is very oop
20:47 <Welkin> things are throw into seemingly random files and functions come out of nowhere because they are inherited by some other class deeper in the hierarchy
20:47 <Tuplanolla> I've probably written some tens of thousands of lines of object-oriented code, but it's only ever ranged from terrible to mediocre.
20:47 <Welkin> mutations everywhere
20:48 <tesan> Well, Ruby is meant to be as much oop as possible, as far as I remember reading on Wikipedia. The maker said "I have seen Python, but it wasn't nearly oop enough in comparison to what I wanted... they had it like an add-on" or something like that.
20:48 soniku joined
20:48 <Welkin> 2/3rds of the codebase is tests, in terms of lines of code
20:49 <Welkin> and things still break all the time
20:49 e14 joined
20:50 <monochrom> In terms of armchair philosophy, I can't argue against the multiple dispatch story, but the single dispatch story is morally wrong.
20:51 Tesan[ES] joined
20:51 <Tesan[ES]> Looks like someone took my nickname. Welkin, did you say something to me in the meantime?
20:51 sssilver joined
20:52 <Tuplanolla> That someone was you, Tesan[ES].
20:52 <Tesan[ES]> More like, someone else connected with "tesan" too and kicke me off of freenode... so I had to change to Tesan[ES].
20:53 <Tuplanolla> Oh. That's always nice.
20:54 nick8325 joined
20:54 <entuland> Tesan[ES], didn't you register your username?
20:54 <MarcelineVQ> hmm, usually that says nick relcained or something rather than ping timeout I thought
20:54 <Tesan[ES]> Well, my OOP experience comes from Python. There, the help function and the way docstring documentation is made allows easy documentation of a class and all the methods and attributes it inherits.
20:54 <EvanR> idris has nice doc strings
20:54 <EvanR> haskell has something
20:55 <Tesan[ES]> @entuland: No, I didn't. I just downloaded Konversation from KDE for Linux and gave it a go.
20:55 <lambdabot> Unknown command, try @list
20:55 <monochrom> Good help systems are not caused by OOP. Only accidentally highly correlated.
20:55 <entuland> Tesan[ES], ah okay
20:56 <monochrom> The same way density of cellphone signal towers is highly correlated to birth rate.
20:56 ubsan joined
20:56 tristanp joined
20:56 <mniip> Tesan[ES], most likely you just timed out. tesan is not registered
20:56 <entuland> Tesan[ES], try issuing "/nick tesan"
20:56 <monochrom> Racket has good help system.
20:57 <Tesan[ES]> Yet, I kept my connection to Mozilla. Well okay I'll check it...
20:57 <tesan> Weird...?
20:57 <nshepperd> blame your internet connection
20:58 <tesan> As I said, I kept my connection to the Mozilla irc server ^^ The rust language chatroom was active all along.
20:58 dfeuer joined
20:58 <tesan> So it's something between my client and freenode
20:59 cef0l0 joined
20:59 <geekosaur> [07 20:52:05] * tesan has quit (Ping timeout: 240 seconds)
21:00 ertesx joined
21:00 <geekosaur> probably behind a NAT and it either wrapped around (common for off the shelf router/APs) or timed out (likewise, occasionally adjustible)
21:00 northfurr joined
21:01 <monochrom> "Only time will tell." :)
21:01 uuplusu_ joined
21:02 <torstein> "NB: With TypeInType, you must import * from Data.Kind" how the hell to I do that?
21:03 <torstein> import Data.Kind (*) gives parse error, and importing Data.Kind alone is not sufficient
21:03 <JScully> i dont understand the error messages
21:03 <JScully> https://pastebin.com/TtAK5q5p
21:03 <JScully> 4:31, Couldn't match type `(Bool, Bool, Bool, Bool)' with `(Bool, b0)'
21:03 <monochrom> Is it OK for you to "import Data.Kind"?
21:04 <tesan> Well, let me ask something this way... I made an OTP [One-Time Pad] Cypher, as those who know this basic cypher, it replaces the characters of a text with the character of the same position in the alphabet + (or minus, depending on choice) the random number assigned to that specific characterposition in the text. How would you approach this project in Haskell-esque style?
21:04 <monochrom> If not, Data.Kind((*)) ?
21:04 <nshepperd> 'import Data.Kind'
21:04 <JScully> Expected type: (Bool, b0) , what is b0 :|
21:05 <nshepperd> neither 'import Data.Kind (*)' nor 'import Data.Kind ((*))' work, eh
21:05 akfp joined
21:05 sphinxo joined
21:05 <sphinxo> What is the name of a property a type system can have to prove its soundness?
21:06 <monochrom> JScully, fst is for 2-tuples only, not 4-tuples such as your Nibble.
21:06 <monochrom> And I do not understand why Nibble is involved at all.
21:06 modlin joined
21:06 sproingie joined
21:06 sproingie joined
21:06 <JScully> ashh
21:07 <JScully> that clears that up thanks
21:07 <monochrom> sphinxo: Is it OK to answer "soundness"? :)
21:07 <monochrom> The other one I can think up now is "has model".
21:08 mmachenry joined
21:09 <MarcelineVQ> torstein: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#the-kind
21:09 <sphinxo> monochrom: has model?
21:12 zeroed joined
21:13 jabesed joined
21:14 meba joined
21:14 fizruk joined
21:14 <jabesed> I still have quite a bit to read on haskell's 'dependent' type programming, and there's something I haven't come across yet and would like to know
21:16 <jabesed> is there some usual idiom for establishing some property relating types, i.e. guaranty that the type T x y, is such that R(x,y) for some selation R
21:16 <jabesed> *guarantee
21:16 mekeor joined
21:17 <sphinxo> it might be worth taking a look at idris for ( for the moment ) nicer syntax and less performance
21:17 jzeus joined
21:17 <jabesed> sphinxo: I've used coq (although I've forgoten a bit), so I'm somewhat familiarised with the basic principles
21:18 <jabesed> but for instance, in coq totality is fundamental
21:18 <sphinxo> fundamental, meaning?
21:18 <jabesed> if I recall correctly you can establish relation between types via a function F(t1,t2) returning either a singleton type or void
21:20 <jabesed> such that when Void is returned you cannot typecheck since you lack a witness (that is, you cannot return a result)
21:20 <jabesed> in Haskell you are free to diverge
21:20 <sphinxo> yeah in idris you can write a function suchlike plus_commutes : (n : Nat) -> (m : Nat) -> n + m = m + n
21:20 <jabesed> right
21:20 lordcirth joined
21:21 <jabesed> and wouldn't that relly on totality, in the sense that without it you could prove false?
21:21 <lyxia> if you assume some good faith on the part of users you can do something like that in Haskell.
21:22 <sphinxo> what would the type n + m = m + n look like in haskell?
21:22 <jabesed> lyxia: how so?
21:22 <lyxia> One can certainly put a bottom anywhere but that's no fun for anyone.
21:22 <Cale> :t fix id
21:22 <lambdabot> a
21:22 <jabesed> lyxia: in the sense that he will himself make sure not to diverge?
21:22 <sphinxo> ( also idris has a nice thing to automatically write code for you )
21:23 <jabesed> lyxia: right, but there's more ways to diverge other than just writing bottom, you may accidently diverge if your computation won't terminate (by accident)
21:23 eacameron joined
21:23 <nshepperd> what does 'T x y, is such that R(x,y) for some relation R' mean?
21:24 <jabesed> nshepperd: T is a type constructor, x and y types passed as arguments, R(x,y) a relation between types
21:24 <sphinxo> is that just a dependent type?
21:25 <lyxia> jabesed: the guarantees are much weaker, but they are still useful.
21:25 <jabesed> sphinxo: not sure if I understood the question...
21:25 <nshepperd> you can make T a GADT and add 'R x y' as a constraint to all its constructors
21:25 <nshepperd> data T x y where { MkT :: R x y => ... }
21:26 cur8or joined
21:26 <sphinxo> Ahh sorry I misunderstood
21:26 <nshepperd> then for any x,y where ¬(R x y) the only element of T x y is bottom
21:26 <jabesed> lyxia: I was wondering though if there was some "workaround"... for instance, we could define the relation as a type family, and have some "error type" that when returned the program fails to compile
21:27 <jabesed> lyxia: disclaimer, I didn't put much thought into this yet, but at first sight seems like a possibility
21:27 <lyxia> a workaround for what
21:28 <jabesed> nshepperd: not sure if I understand how that works... you mean make R a class?
21:29 <jabesed> lyxia: a workaround for implementing certain checks that in languages like cock relly on totality
21:30 <tippenein> `there is no file-watch for cabal, right?
21:31 <jabesed> lyxia: the idea would be that while in a total language we return void in order to guarantee a type with no possible term that makes it compile (for lack of witness), here we'd just return an error type that guarantees a type error
21:31 codesoup joined
21:32 <nshepperd> jabesed: i thought R was already a class. but if it's a function like * -> * -> Bool then that works too, putting (R x y ~ True) as the constraint
21:32 <JScully> test :: (Nibble -> Nibble -> Nibble) -> [( Nibble , Nibble )] -> String
21:33 <JScully> i have this signature
21:33 <JScully> the first parameter is a function, the second a list
21:33 <JScully> is it possible to run all elements in the list with this function
21:34 <Tuplanolla> :t map . curry
21:34 <lambdabot> ((a, b) -> c) -> [a] -> [b -> c]
21:34 <seequ_> JScully: map (uncurry f) l
21:34 <Tuplanolla> Yes, that direction.
21:34 <Tuplanolla> :t map . uncurry
21:34 <lambdabot> (a -> b1 -> b) -> [(a, b1)] -> [b]
21:34 stranger64 joined
21:34 soniku joined
21:35 <jabesed> nshepperd: ok that's what I was looking for, so what happens if: not (R x y)
21:35 <jabesed> nshepperd: will it not type check?
21:35 <JScully> hmm interesting
21:36 <nshepperd> jabesed: creating a value of that type other than bottom will not type check
21:37 <jabesed> nshepperd: yeah but that's the problem I was raising :/ you can still satisfy it using bottom
21:37 <jabesed> nshepperd: which is why I was saying it would be nice to have something like an error type
21:37 <lyxia> jabesed: I think sometimes it's still useful to have the empty type around than just crash.
21:38 <jabesed> nshepperd: then one could define R as a type family
21:38 <JScully> how to i iterate over all pairs ?
21:38 <jabesed> lyxia: I don't mean crash, I mean not type check
21:38 <seequ_> JScully: just map
21:38 <nshepperd> I don't know if it's possible to make simply naming 'T x y' fail to type check
21:38 <JScully> it seems like this only gives the first pair of the list
21:39 obadz joined
21:39 <lyxia> jabesed: that's what I meant. You're introducing a type level bottom, and bottom can colloquially be interpreted as a crash.
21:39 blym_ joined
21:40 <jabesed> lyxia: why wouldn't you want that though?
21:41 arcsin joined
21:41 dm3 joined
21:42 <seequ_> Tuplanolla: 00 :)
21:43 <Putonlalla> Now what?
21:44 e14 joined
21:45 <JScully> whats the difference [(Nibble, Nibble)] vs (Nibble, Nibble)
21:45 <JScully> list vs tupel ?
21:46 <entuland> not just that, for the few thigs I know about haskell JScully
21:46 <lyxia> "list of tuples" vs "tuple"
21:46 <entuland> the former is a list with one tuple inside
21:46 <entuland> the latter just the tuple
21:47 <JScully> ok
21:47 <JScully> so if i want to get the first item of the tupel i need to something like
21:47 <entuland> lyxia actually got that more precise than me I guess, JScully
21:47 <JScully> fst(fst(list))
21:48 <JScully> acutally
21:48 <JScully> fst(head(list))
21:48 <JScully> as it seems
21:50 <entuland> uhm... just "fst (head list)" should be enough I think, the inner paren is not necessary AFAICT JScully
21:50 modlin joined
21:50 <JScully> oh yes :)
21:50 splanch joined
21:50 <entuland> > fst (head [(1, 2)])
21:51 <lambdabot> 1
21:51 <entuland> yep
21:52 <JScully> so what is the right approach to return a string from a function
21:52 <JScully> should i use show?
21:52 <JScully> i need to concat it from different values
21:52 hiratara joined
21:53 <entuland> I bet the best option there is to show your attempts in a bin or the alike, JScully, so to provide context
21:53 <entuland> but I'm new here and I'm not sure about the customs
21:54 <JScully> just generally, i have a function that returns a string which i would call from different other functions
21:54 <JScully> i only want to "show" the string in the calling-functions
21:55 insitu joined
21:55 sphinxo joined
21:55 <JScully> in other language you would use something like "return"
21:55 <entuland> unfortunately I'm not that into the language to be of any help there... I've arrived just here: http://learnyouahaskell.com/higher-order-functions in my study of Haskell
21:55 <seequ_> JScully: show gives a string representation of a thing. That might or might not be what you want.
21:56 <seequ_> JScully: oh, return us implicit
21:56 <seequ_> JScully: f x = x + 1 returns x + 1
21:56 <seequ_> return is implicit*
21:57 kiboneu joined
21:57 <c_wraith> Think of it as being an expression-oriented language. Expressions don't return values, they *have* values.
21:57 <JScully> ok so i have a function A that return an Integer, i have another function that makes 4 calls on that function A and now i want to return it as a string
21:57 <JScully> is it, show(functionA a) ++ show(functionA b) ++ and so on
21:57 <JScully> ?
21:58 <Cale> JScully: that should work
21:58 <c_wraith> That's basically right. If you have problems, show us the precise code
21:58 northfurr joined
21:58 <Cale> You could also write something like concatMap (show . functionA) [a,b..]
21:59 <Cale> (though, it would be surprising if you didn't want to also stick some spaces in there, so maybe that's a little too terse)
21:59 <JScully> the problem is when i call this function from oither fcuntions that return strings
21:59 <JScully> i have show(show(show(...)))
21:59 <seequ_> :t concatMap
21:59 <lambdabot> Foldable t => (a -> [b]) -> t a -> [b]
21:59 <JScully> which gives me a odd looking output
22:00 <c_wraith> well. don't show String values.
22:00 <c_wraith> they already are Strings
22:00 <seequ_> I've been folding for no reason
22:00 <JScully> i basically want to call show only one time
22:00 <JScully> hm
22:00 <MarcelineVQ> JScully: consider the ++ you used above as a possible solution to that
22:00 <Cale> JScully: Yeah, just don't apply show to something if it's already a String
22:00 yellowj joined
22:00 <sphinxo> how would you go about writing something like http://lpaste.net/280646335785336832 in haskell?
22:01 <Cale> applying Show to a String adds quotes and escapes anything outside of printable ascii
22:01 <JScully> how do i concat two functions that both return strings
22:01 <Cale> JScully: You mean concatenate their String results? Using (++)
22:01 <JScully> myWrapper = functionA() ++ functionB()
22:01 <JScully> is not working
22:01 <sphinxo> drop the ()
22:01 <JScully> oh wait
22:01 <JScully> it is
22:01 mbw joined
22:01 <JScully> :| sorry
22:02 <mbw> How can I get an Array (from the array package) from a Vector?
22:02 <sphinxo> three = add 1 2
22:02 <MarcelineVQ> sphinxo: what does -> mean there?
22:03 <Rembane> mbw: Via a list?
22:03 <sphinxo> MarcelineVQ: returns a function type
22:03 <mbw> But there should also be a dirty way, right?
22:03 eacameron joined
22:03 <JScully> does haskell has function to convert 1001 to 9 ? binary to decimal ?
22:03 <mbw> I thought array was the underlying representation anyway.
22:03 <sphinxo> so given [Int, Int, Int] produce a function like Int -> Int -> Int
22:03 <MarcelineVQ> are you crafting a n-ary function from a list of types?
22:03 <MarcelineVQ> ah
22:04 <Cale> :t readIntAtBase
22:04 <lambdabot> error: Variable not in scope: readIntAtBase
22:04 <Cale> oh, right
22:04 <Cale> it's just readInt
22:04 <Cale> :t readInt
22:04 <lambdabot> Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
22:05 <Cale> > readInt 2 (`elem` "01") digitToInt "1001"
22:05 <lambdabot> [(9,"")]
22:05 <JScully> uff
22:06 <Cale> It's pretty generalised :P
22:06 <Rembane> mbw: Maybe, why do you need a dirty way?
22:06 <JScully> ok 2 is the base
22:06 <JScully> you have 01 as valid inputs
22:07 <JScully> and a function that does some magic :D
22:07 <Cale> yeah, and digitToInt is used to convert the '0' and '1' into actual Int values.
22:08 <lyxia> sphinxo: type family Interp (as :: [*]) where Interp '[t] = t ; Interp (h ': t) = h -> Interp t
22:08 <Cale> and then the result is a list of possible parses (which should only ever really have 0 or 1 elements), each of which consists of the number that was parsed, and the remainder of the string
22:08 montag451___ joined
22:09 Elhamer_ joined
22:09 <JScully> so i need to sum it up?
22:09 <Cale> Well, I don't know what you're trying to do
22:09 <JScully> convert 1001 into 9
22:09 <mbw> Rembane: If I work with an immutable vector, I shouldn't have to copy it in order to work with an equivalent array representation.
22:09 <Cale> It produces 9 there
22:10 <JScully> but it does not return an int right
22:10 <Cale> (Well, it produces [(9, "")], but you can pattern match that)
22:10 <Cale> The parse might in some cases fail
22:10 <JScully> i se
22:10 <Cale> > readInt 2 (`elem` "01") digitToInt "apple"
22:10 <JScully> see
22:10 <lambdabot> []
22:10 <Cale> > readInt 2 (`elem` "01") digitToInt "10001001apple"
22:10 <lambdabot> [(137,"apple")]
22:10 <lyxia> sphinxo: http://lpaste.net/355304 a proof of n + m = m + n
22:11 <sphinxo> lyxia: woah! awesome!
22:11 tg` joined
22:11 Quintasan joined
22:11 Quintasan joined
22:12 tristanp joined
22:12 <Rembane> mbw: Why do you need an array representation?
22:12 fryguybo1 joined
22:12 arw__ joined
22:13 xcmw_ joined
22:13 lispy_ joined
22:13 Liskni_s1 joined
22:13 MitchellSalad_ joined
22:13 jdog joined
22:14 <mbw> Rembane: Since I am trying to work with multi-dimensional arrays. I tried Repa, Accelerate, hmatrix, hTensor and now I want to go with the array package.
22:14 oisdk joined
22:15 <Rembane> mbw: I see. Fun!
22:15 <JScully> my last task is to represent 1001 as -7 (complement of two ???)
22:15 <mbw> I *could* just scratch vector alltogether, but being able to zip/unzip in O(1) time is helpful, since it can assure things like "these vectors all have the same length".
22:15 foton joined
22:15 <JScully> does anyone know where -7 is coming from :|
22:15 <Putonlalla> @google two's complement integer
22:15 <lambdabot> https://en.wikipedia.org/wiki/Two%27s_complement
22:15 <JScully> ahh its that one
22:15 <JScully> thanks
22:21 rootnode_ joined
22:21 karce- joined
22:21 thang1_ joined
22:21 TimWolla_ joined
22:21 JeanCarloMachado joined
22:21 HappyEnte_ joined
22:21 Sornaensis_ joined
22:21 Majoo joined
22:21 sdothum_ joined
22:21 mw_ joined
22:21 aarvar joined
22:21 _Adluc_ joined
22:22 eacameron joined
22:22 govg joined
22:23 \u joined
22:23 Elsi joined
22:23 dpn` joined
22:23 mniip joined
22:24 <JScully> hm does not seem there is such function to represent two complements
22:24 splanch joined
22:24 m00n joined
22:25 splanch_ joined
22:25 megaTherion joined
22:25 Vbitz joined
22:26 darlan joined
22:27 splanch__ joined
22:27 Jesin joined
22:28 <mbw> What is this netsplit thing?
22:29 <Clint> it's what makes irc go 'round
22:30 <mbw> So what was that message just now?
22:30 mudfog_ joined
22:31 cjwelborn joined
22:33 cschneid_ joined
22:33 <hpc> mbw: freenode the network is made up of multiple irc servers distributed across the world
22:33 splanch joined
22:33 <hpc> mbw: when one can't talk to the rest, the network "splits"
22:34 <mbw> I see.
22:34 JeanCarloMachado joined
22:34 <sphinxo> is it possible to make type level lists lazy?
22:35 <sphinxo> am I even making sense
22:35 <mbw> Btw I found out that I can pattern match against the Vector from Data.Vector.Primitive, to get access to the underlying ByteArray.
22:35 <mbw> Cool stuff.
22:35 Kuros` joined
22:36 <c_wraith> sphinxo: making sense? yes. Can you do it? Not at the moment. Types are strict. (Until someone comes along with a GHC extension to change that...)
22:36 <JScully> my rippleCarryAdder is not working :(
22:36 <sphinxo> c_wraith: ahh ok thanks
22:36 splanch_ joined
22:36 <c_wraith> sphinxo: I don't know of any current plan to add it, but who knows what'll happen in the future. 5 years ago, I figured GHC would never get dependent types...
22:36 <sphinxo> JScully: paste the entire code somewhere: http://lpaste.net/
22:37 Uakh joined
22:37 _paul0 joined
22:37 n1k joined
22:37 sleblanc joined
22:37 CosmicRay joined
22:38 splanch joined
22:38 <JScully> sphinxo this page does not let me paste
22:38 <JScully> it times out
22:39 <sphinxo> oh :|
22:39 <sphinxo> well any paste site would do
22:39 <JScully> https://pastebin.com/bCfxB6KL
22:40 <JScully> well it does compile but gives a wrong result
22:40 M-Illandan joined
22:40 sudoreboot[m] joined
22:40 <sphinxo> What's get1st
22:40 markasoftware joined
22:40 <JScully> first element of the nibble
22:41 <JScully> implemented like get1st (a,_,_,_) = a
22:42 modlin joined
22:42 tomphp joined
22:42 <JScully> rippleCarryAdder (True, False, False, True) (False, False, False, True) gives True, False, False, False
22:42 <JScully> but it should give True, False, True, False
22:42 <monochrom> You're really better off writing like "rippleCarryAdder (a1, a2, a3, a4) (b1,b2,b3,b4) = ..."
22:42 majoh joined
22:42 psyklist joined
22:42 strawberry joined
22:42 sw1nn joined
22:42 jo`ve joined
22:42 tv joined
22:42 ego joined
22:42 mbrcknl joined
22:42 Lex[m]1 joined
22:42 Cir0X joined
22:42 Profpatsch joined
22:42 redcedar joined
22:42 cdornan joined
22:42 angerman joined
22:42 kwantam joined
22:42 bubinomab joined
22:42 Yves[m]1 joined
22:42 zar[m] joined
22:42 colton[m] joined
22:42 mmmrrr[m] joined
22:42 jacqueline[m] joined
22:42 hendrik[m] joined
22:42 roadrunner168[m] joined
22:42 davidar joined
22:42 Adios joined
22:42 Riviera_ joined
22:42 dmj` joined
22:42 Nikotiini joined
22:42 davean joined
22:42 CARAM__ joined
22:43 <JScully> yes, well the signature was given :|
22:43 <JScully> i could change it temporary though
22:43 javjarfer_ joined
22:43 <JScully> but would need to switch back
22:43 <MarcelineVQ> that doesn't change the signature
22:43 <JScully> oh
22:43 e14 joined
22:44 dmj` joined
22:44 javjarfer_ joined
22:44 Uakh joined
22:44 darlan joined
22:45 <MarcelineVQ> monochrom is showing you how to pattern match on a Nibble to name its parts, just like what your get functions do but all at once
22:45 Brando753-o_O_o joined
22:45 darlan joined
22:45 sivs joined
22:45 <JScully> i see
22:45 CARAM__ joined
22:45 <JScully> i change this now
22:46 texasmynsted joined
22:46 sproingie joined
22:46 sproingie joined
22:47 henriksod joined
22:47 <JScully> https://pastebin.com/8jkAqRBX
22:47 <JScully> looks better
22:48 cschneid_ joined
22:48 jle` joined
22:48 jle` joined
22:48 <JScully> ok double check my fulladder
22:48 <monochrom> Next thing you need is a "where"-clause like "where (s1, c1) = fulladder a1 b1" etc for well organization and easy inspection.
22:49 <JScully> full adder is working correctly
22:49 <monochrom> (Is lpaste no working?)
22:49 <MarcelineVQ> it's working, just sometimes you gotta ask it twice lately
22:50 <monochrom> Ah
22:50 sleffy joined
22:50 psyklist left
22:50 orphean joined
22:51 <JScully> maybe i should recheck the expected result
22:51 <JScully> does anyone know a online rippleCarryAdder?
22:51 oisdk joined
22:52 <lpaste> monochrom pasted “Use patterns and local defs already” at http://lpaste.net/355306
22:52 <monochrom> That.
22:52 <monochrom> Err wait a second this makes no sense. fulladder has how many parameters?
22:52 <monochrom> Oh, my mistake.
22:53 <JScully> three
22:53 eacameron joined
22:53 <lpaste> monochrom revised “Use patterns and local defs already”: “Use patterns and local defs already” at http://lpaste.net/355306
22:53 <monochrom> Like that.
22:54 <monochrom> Well-organized unrepetitive code is easiest to inspect and debug (and probably no bug to de in the first place).
22:54 <JScully> looks good
22:54 <MarcelineVQ> even just a fullAdderSnd in the where combining fulladder and snd would help a lot for readability
22:55 <JScully> let me think about the todo part :D
22:55 darjeeling_ joined
22:55 shayan_ joined
22:57 <sphinxo> JScully: I think your fulladder is implemented incorrectly
22:57 <sphinxo> oh wait
22:57 <JScully> i have checked it against the truth table :|
22:58 eacameron joined
22:58 <sphinxo> expected output for (True, False, True, False) (False, False, False, False)
22:58 <sphinxo> ?
22:58 <sphinxo> for rippleCarryAdder
22:58 <JScully> T,F,T,F
22:58 <JScully> no wait
22:58 <JScully> (T,F,F,T) (F,F,F,T) SHOULD BE T,F,T,F
22:59 <JScully> thats the only combination i have
23:00 cschneid_ joined
23:02 blym_ joined
23:06 darlan joined
23:07 mjora7 joined
23:07 alveric2 joined
23:07 nakal_ joined
23:08 sgronblo joined
23:09 eacameron joined
23:12 soniku joined
23:12 infinitegeste joined
23:12 strykerkkd joined
23:13 Levex joined
23:14 cpennington joined
23:14 meba joined
23:15 acarrico joined
23:15 jao joined
23:18 infinitegeste left
23:19 Wizek joined
23:20 jer1 joined
23:20 blym_ joined
23:22 eacameron joined
23:22 mizu_no_oto_work joined
23:22 splanch joined
23:22 crosleyt joined
23:23 mjora7 joined
23:24 hololeap joined
23:26 ChaiTRex joined
23:27 eacameron joined
23:29 <monochrom> Perhaps False means 1, True means 0. :)
23:30 <JScully> hm
23:30 <JScully> well it gives 1000
23:30 <JScully> not 1010 or 0101
23:31 <JScully> its messed up somewhere :|
23:31 <monochrom> To be fair I don't even know who's MSB and who's LSB.
23:31 <JScully> whats that
23:32 <hololeap> something about eggs
23:32 <monochrom> If you don't know them, you aren't ready for bitwise operations.
23:32 <hololeap> basically, its the direction the bits are read
23:33 <hololeap> left-to-right or right-to-left
23:33 <JScully> ahh, well i dont know the english abbreviations
23:33 <hololeap> stands for most-significant bit and least-significant bit
23:33 <JScully> yes i just looked it up
23:33 <JScully> thanks
23:34 <hololeap> yw
23:35 dresuer joined
23:38 <mniip> 1494199954 [02:32:34] <monochrom> If you don't know them, you aren't ready for bitwise operations.
23:38 <mniip> tbh in bit"wise" operations you don't need to know
23:38 <mniip> s/tbh/to nitpick,/
23:40 <monochrom> It would be cool to hold a debate between you and maerwald.
23:42 louispan joined
23:43 tromp joined
23:43 <JScully> how big is the depth of a 2^k-Bit carry select adder?
23:43 <JScully> how do i calculate that?
23:45 <monochrom> Are you sure it's 2^k bits? Not just k bits?
23:45 <JScully> the question states 2^k
23:45 <monochrom> But I forgot carry select adders.
23:45 <JScully> i dont even know what 2^k is :(
23:45 theDon_ joined
23:46 <monochrom> Ah! They want nice powers of 2, like 8 bits or 16 bits or 32 bits or 64 bits.
23:47 <JScully> can you explain that further please
23:47 <mniip> monochrom, but debate is so much harder than shitposting on irc
23:48 <monochrom> Oh! Just s/debate/shitposting then.
23:48 chrissie joined
23:48 <mniip> count me in
23:48 <JScully> what does k stand for?
23:48 {emptyset} joined
23:48 <monochrom> k stands for 0 or 1 or 2 or 3 or 4 or ...
23:48 markus1199 joined
23:48 markus1209 joined
23:48 <monochrom> 32 bits is 2^5 bits.
23:49 <JScully> ah
23:50 <JScully> on the internet it says the gate level depth is O(sqrt n)
23:50 <monochrom> Very likely n = 2^k
23:51 <JScully> so a 32 bit carry select adder has a depth of O(sqrt 2^5)
23:51 <JScully> where O just means "worst case" ?
23:51 <mniip> monochrom, to me bitwise functions are strictly those that are expressible with 'zipWith' on bit arrays
23:52 <rightfold> JScully: O means upper it never goes above that
23:52 <mniip> O is upper asymptotic bound
23:52 rkazak joined
23:52 <JScully> thanks
23:53 <monochrom> http://www.cs.utoronto.ca/~trebla/CSCB63-2017-Summer/01-asymptotic-p1.pdf by yours truly.
23:53 splanch joined
23:53 JoshS joined
23:53 <rightfold> Mnemonic is the position of the "-": Ω has it low, Θ has it in the middle, O has it up in cursive 😛😂
23:54 <Lokathor> https://github.com/Lokathor/learnopengl/blob/master/app/Lesson01.hs wheeeee
23:54 dfordivam joined
23:54 <mniip> rightfold, um to me the mnemonic was
23:54 <mniip> O is really omicron
23:54 MP2E joined
23:55 <monochrom> rightfold: Then you will like my cursive joke https://plus.google.com/u/0/102208456519922110915/posts/PC5W3XVtq5M
23:55 <rightfold> σ
23:58 <mniip> rightfold, that's the small-o
23:58 <mniip> you're looking for big omicron
23:59 infinity0 joined