<    April 2017    >
Su Mo Tu We Th Fr Sa  
 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 _2_9  
00:00 nakal joined
00:01 vaibhavsagar joined
00:01 ExpHP joined
00:01 NoCreativity joined
00:02 jmcarthur joined
00:02 carlosda1 joined
00:02 codesoup joined
00:03 muyfine joined
00:04 soLucien joined
00:04 wroathe joined
00:04 orhan89 joined
00:06 abhiroop joined
00:11 fresheyeball joined
00:11 <fresheyeball> is there a haskell version of this? https://github.com/lodash/lodash/blob/master/deburr.js
00:12 jer1 joined
00:12 meandi_2 joined
00:15 yellowj joined
00:18 Gurkenglas_ joined
00:22 exferenceBot joined
00:22 plutoniix joined
00:23 mjora7 joined
00:23 wroathe joined
00:25 sleffy joined
00:25 <MVQq> dunno, seems like https://hackage.haskell.org/package/text-icu- is a good bet though for a place to start
00:27 <MVQq> there's also https://github.com/lodash/lodash/blob/master/.internal/deburrLetter.js for another spot to look at to determine what you need
00:29 blbrown_win3 joined
00:30 filterfish joined
00:33 ddere joined
00:33 jer1 joined
00:37 robertkennedy joined
00:42 msko joined
00:45 Sose_ joined
00:46 abhiroop joined
00:50 bhiliyam joined
00:51 anishathalye joined
00:52 spacej joined
00:52 eacameron joined
00:53 splanch joined
00:54 jer1 joined
00:54 Stanley00 joined
00:54 splanch_ joined
00:55 splanch__ joined
00:56 splanc___ joined
00:57 blender joined
00:58 eacameron joined
00:59 patbecich joined
00:59 vaibhavsagar joined
00:59 erisco joined
01:00 nighty-- joined
01:03 carlosda1 joined
01:03 eacamero_ joined
01:07 HoierM joined
01:07 andyhuzhill joined
01:08 eacameron joined
01:08 eschnett joined
01:11 justanotheruser joined
01:12 shutdown_-h_now joined
01:13 m1dnight_ joined
01:14 yogsototh joined
01:14 jer1 joined
01:18 crobbins joined
01:18 v0latil3 joined
01:19 abhiroop joined
01:20 jstvz joined
01:20 <v0latil3> Is there a way to have ghci print the entered line back to stdout? or can anyone think of a way to record what happens in the terminal? I want to do something like $ script -c ghci < test.txt, and have it show the expressions I am testing, and the output
01:21 <v0latil3> Sorry if this isn't specific enough to haskell channel
01:21 <Tuplanolla> I'm just about to leave, but check out `ttyrec`, v0latil3.
01:22 infinity0 joined
01:22 <Koterpillar> v0latil3: 'script' utility might be something that you're looking for
01:22 <v0latil3> I'm already using script, and it works if I manually type stuff into the terminal, but I would like to just redirect a file of tests instead of doing that
01:23 revprez joined
01:23 e14 joined
01:23 edmundsecho joined
01:23 <v0latil3> I think I can just paste it into the terminal from clipboard
01:25 filterfish joined
01:25 <v0latil3> yeah that worked! I guess that works on a desktop at least. thanks for the suggestions
01:26 <peddie> v0latil3: what if you point stdin at the file?
01:26 filterfish joined
01:26 Wizek joined
01:26 Wizek_ joined
01:26 <v0latil3> I tried doing like 0>1 but it just exists whatever command I do right away
01:27 <v0latil3> it seems script only records stdin if its the tty
01:29 matt179 joined
01:30 kenobi_ joined
01:31 kadoban joined
01:35 jer1 joined
01:36 sword865 joined
01:39 Supersonic112_ joined
01:39 carlomagno joined
01:40 Welkin joined
01:40 carlomagno joined
01:43 wroathe joined
01:45 matt179 joined
01:46 Sose_ joined
01:52 alue-42 joined
01:53 AfC joined
01:55 jer1 joined
01:57 edmundsecho joined
01:58 blender joined
01:58 descender joined
01:59 markus1189 joined
02:00 sproingie joined
02:00 sproingie joined
02:00 hucksy joined
02:00 eacameron joined
02:02 alios joined
02:03 carlosda1 joined
02:06 sucks joined
02:07 eacameron joined
02:07 orhan89 joined
02:08 Spondyl joined
02:08 ystael joined
02:08 cpup joined
02:10 Goplat joined
02:11 afarmer joined
02:11 eacamero_ joined
02:12 halogenandtoast joined
02:13 takle joined
02:13 dan_f joined
02:14 <halogenandtoast> I feel like I should know this, but I can't seem to work out the types. I have a function that returns IO (Maybe String) and I have a function String -> Maybe Int and I want to get IO (Maybe Int) from taking the first string and passing it in the second, is there an operator I can use
02:15 <halogenandtoast> s/operator/infix function/
02:15 <vaibhavsagar> (>>=)
02:15 <vaibhavsagar> but you need to use fmap to get at the Maybe inside your IO
02:15 eacameron joined
02:16 <halogenandtoast> vaibhavsagar: I think that was the part I was missing the fmap
02:16 <vaibhavsagar> :)
02:16 jer1 joined
02:16 <halogenandtoast> but I don't know where it goes
02:16 <halogenandtoast> I'll think about your statement for a moment.
02:16 <kadoban> halogenandtoast: Either in a do block match the Maybe String and then use the (>>=) for Maybe and then return, or you can do something with fmap (>>=)
02:17 <vaibhavsagar> so if you have f :: String -> Maybe Int
02:17 <vaibhavsagar> and some a :: Maybe String
02:17 <vaibhavsagar> then you should be able to do a >>= f
02:18 <halogenandtoast> right that makes sense
02:19 eacamero_ joined
02:19 <vaibhavsagar> when IO gets involved and you have some b :: IO (Maybe String)
02:19 <vaibhavsagar> you want _ <$> b :: IO (Maybe Int)
02:19 <vaibhavsagar> and the (>>= f) is somehow involved in the _
02:20 <vaibhavsagar> try using typed holes in GHCi and see if that helps
02:20 darjeeling_ joined
02:20 soniku joined
02:20 <halogenandtoast> Oh that's crazy
02:20 <halogenandtoast> mguess <- (>>= readMaybe ) <$> (ask "Guess a number [1-10]")
02:20 <halogenandtoast> I could have less parens of course
02:22 <vaibhavsagar> great :)
02:22 conal joined
02:23 filterfish joined
02:24 wroathe joined
02:24 chao-tic joined
02:25 ebzzry joined
02:26 orhan89 joined
02:27 carlomagno joined
02:27 <halogenandtoast> vaibhavsagar: Thanks for the help!
02:27 <halogenandtoast> I probably won't write my code like this, but I like seeing how to connect these pieces
02:28 <sophiag> hi vaibhavsagar :)
02:29 blender joined
02:30 uuplusu joined
02:31 <vaibhavsagar> hi sophiag!
02:31 splanch joined
02:34 <Squarism> is there some channel type that you dont need to duplicate for each sender?
02:35 <Squarism> oh.. or is it only receiver chans you dupe?
02:35 markus1189 joined
02:35 <pacak> There's https://hackage.haskell.org/package/broadcast-chan
02:36 <pacak> Or broadcast chan in stm
02:36 <sophiag> vaibhavsagar: how are things?
02:37 jer1 joined
02:37 <pacak> sophiag: Are those things related to Haskell?
02:37 vtomole joined
02:38 path[l] joined
02:38 splanch joined
02:38 {emptyset} joined
02:38 <sophiag> pacak: sure
02:38 <vtomole> I'm getting a "Could not find module ‘Monad’" I did a cabal update and reinstall mtl, but that did fix anything.
02:39 <pacak> vtomole: There is no module Monad.
02:39 Warrigal joined
02:39 <Warrigal> Hey, I'm wondering if this data type is defined in the standard libraries anywhere...
02:39 <vtomole> That's the error i got when i tried to compile my file.
02:39 <Warrigal> data T a = T { runT :: a }
02:40 meba joined
02:40 <pacak> vtomole: You probably have "import Monad" somewhere - that's wrong.
02:40 <pacak> Warrigal: Identity?
02:40 <pacak> @src Identity
02:40 <lambdabot> newtype Identity a = Identity { runIdentity :: a }
02:40 <pacak> Unless you really want data
02:40 <Warrigal> I do really want data.
02:40 <vtomole> I'm new to haskell. I just following this tutorial:https://upload.wikimedia.org/wikipedia/commons/a/aa/Write_Yourself_a_Scheme_in_48_Hours.pdf
02:40 splanch_ joined
02:41 <pacak> vtomole: paste your code somewhere?
02:41 <isd> vtomole: put in in a pastebin?
02:41 <isd> bah, beat me to it.
02:41 <Warrigal> T is just a trivial lazy container.
02:42 <vtomole> https://pastebin.com/j21AHT8M
02:42 <pacak> Warrigal: How about type T a = Either Void a? :)
02:42 <pacak> vtomole: import Control.Monad maybe?
02:43 <Warrigal> I think that's not quite the same, actually... then "undefined", "Left undefined", and "Right undefined" are all different things.
02:43 <vtomole> Awesome! Thank you.
02:43 <Koterpillar> Warrigal: State () a
02:43 <pacak> vtomole: And it's better to put type signatures next to code
02:43 rcschm joined
02:43 <Warrigal> Anyway, I'm just wondering if this happens to already exist somewhere or not. It's not like T is difficult to implement. :)
02:44 splanch joined
02:44 <vtomole> Allright
02:45 kenobi_ joined
02:45 wroathe joined
02:46 <AfC> stack is helpfully saying "Package uses a custom Cabal build, but does not use a custom-setup stanza Using the explicit setup deps approach based on configuration Strongly recommend fixing the package's cabal file"
02:46 <AfC> that seems to imply a dependency on Cabal >= 1.24
02:46 <AfC> is that common and in the wild now, or would slapping that in a .cabal file that works for people with older codebases screw them up?
02:47 <pacak> AfC: That will screw up people with older codebases.
02:50 biglambda joined
02:50 filterfish joined
02:51 bhiliyam joined
02:54 kellytk joined
02:55 exferenceBot joined
02:55 <kellytk> As I understand it Haskell models time as a type of IO. Is that correct and if so what does it look like in Haskell syntax?
02:56 <tsani> kellytk: "models time" ?
02:56 <pacak> As type of IO?
02:56 Kuros` joined
02:57 austinkeeley joined
02:57 jer1 joined
02:59 hexagoxel joined
03:00 <kellytk> I asked about it here a day or so ago, if Haskell modeled time as a type of IO with the progression of time as IO events. Someone affirmed but may be incorrect
03:01 <pacak> O_o
03:01 takle joined
03:02 anishathalye joined
03:02 <AfC> pacak: don't suppose you know what an older version of Cabal would do with stanzas it doesn't understand? I seem to remember from a few years ago that it was a bit grumpy about that sort of thing.
03:03 <geekosaur> kellytk, "Haskell" does not. some FTP libraries likely do
03:03 <geekosaur> er FRP
03:03 <kellytk> How does Haskell model time geekosaur?
03:03 <geekosaur> ...
03:04 <monochrom> Not modeled. Left to libraries. Free for all. Wild wild West.
03:04 <geekosaur> ^
03:04 <kellytk> I understand I'm likely not using Haskell terminology, but in plain language
03:04 <geekosaur> plain language is still "it's what the library does, the language fdoesn't care"
03:04 <geekosaur> this is not javascript in a browser
03:04 carlosda1 joined
03:04 <kellytk> How would a Haskell library idiomatically model time?
03:04 <geekosaur> or javascript pretending to be in a browser
03:04 <pacak> AfC: I can imagine that's ghc 7.0
03:05 <AfC> heh
03:05 hazyPurple_ joined
03:05 <monochrom> Depends on what you use time for.
03:05 <AfC> pacak: GHC 7.0 was grumpy about quite a few things
03:05 <geekosaur> we really are not communicating, are we?
03:05 <monochrom> The answer depends on the question. The solution depends on the problem.
03:05 kattak joined
03:06 <geekosaur> what is idiomatic depends on the idiom the library chooses to support.
03:06 sucks_ joined
03:06 <geekosaur> it is up to *the library*.
03:06 <pacak> AfC: Hmm... Or probably 7.2 as well.
03:06 <AfC> kellytk: so if you're asking how the runtime slices up resources (available compute) and does scheduling, then "how does Haskell model time" makes sense. But I imagine you're asking "how do I do calculations on times and dates?"
03:06 wroathe joined
03:07 <kellytk> AfC: The former
03:07 <AfC> ah
03:07 abhiroop joined
03:07 <kellytk> I assume time in Haskell isn't a separate concept implemented in some base language, but is rather implemented using regular/core Haskell concepts
03:08 <AfC> kellytk: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts (gawd, but there you are)
03:08 orhan89 joined
03:08 <monochrom> I think you need to drop the habit of speaking like there is "the time".
03:08 anishathalye joined
03:08 <monochrom> There are approximately five different "time"s.
03:09 <monochrom> The other day I was looking at some Linux man pages and saw the Linux kernel already provides 3 different clocks in one single man page.
03:09 <monochrom> So, which one do you mean? #1? #2? #3?
03:10 <geekosaur> you thinking of itimers?
03:10 felixsch_ joined
03:10 <geekosaur> which are different from alarms, and different again from the time syscalls (which are at least related to each other)
03:10 <monochrom> I think I was looking at the man page concerning VTALARM
03:10 <AfC> kellytk: and http://haskell.cs.yale.edu/wp-content/uploads/2013/08/hask035-voellmy.pdf (I think that's the latest paper about the I/O manager that's newer than the New I/O manager)
03:10 <monochrom> At any rate 3 is a lower bound.
03:11 <geekosaur> https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/base- has basic information about thread scheduling
03:11 <geekosaur> the documentation for the internal module GHC.Conc has more, beyond that you;re at the Commentary/Rts page
03:11 <geekosaur> right, that's itimers
03:12 xcin joined
03:12 ZelteHonor joined
03:13 takle joined
03:13 texasmynsted joined
03:13 <geekosaur> linux has ITIMER_REAL and alarm() do the same thing IIRC but some other OSes separate them (which is "fun"). then ITIMER_VIRTUAL (SIGVTALRM) and ITIMER_PROF (reserved for profiling libraries)
03:14 <kellytk> AfC, geekosaur: Thanks I'll read more
03:14 <geekosaur> and none of the three necessarily relates to actual time as returned in low precision by time() or high precision by gettimeofday()
03:14 juhp joined
03:14 soniku joined
03:15 <geekosaur> (unless you're in a realtime scheduling queue in which case ITIMER_REAL will at least try to stay in step with system time)
03:16 Soft joined
03:16 asthasr joined
03:17 biglambda joined
03:17 <geekosaur> anyway: short version is you have two different runtimes available, a green threads runtime and the multithreaded (N:M) runtime. threads generally yield when they would block or when they allocate memory (in N:M mode this may allow the capability/OS thread to switch to a different Haskell thread)
03:18 <geekosaur> Haskell threads are very lightweight compared to OS threads, so multithreaded programs may spawn quite a few threads
03:18 jer1 joined
03:20 Micamo joined
03:22 takle joined
03:24 <kellytk> Thank you
03:25 darlan joined
03:26 takle_ joined
03:27 wroathe joined
03:30 blender joined
03:30 justan0theruser joined
03:30 kormoc1 joined
03:31 jer1 joined
03:31 matt179 joined
03:32 systemfault joined
03:32 govg joined
03:34 biglambda joined
03:36 uglyfigurine joined
03:39 hamishmack joined
03:40 sleffy joined
03:41 forgottenone joined
03:42 locallycompact joined
03:42 ystael joined
03:46 Reynaldo2333 joined
03:46 Reynaldo2333 left
03:46 tripped joined
03:47 FjordPrefect joined
03:47 abhiroop joined
03:48 m3adi3c joined
03:50 anishathalye joined
03:53 eklavya joined
03:54 hybrid joined
03:54 anishathalye joined
03:58 takle joined
03:58 matt179 joined
04:01 brynedwardz joined
04:02 benl23 joined
04:02 des_ joined
04:03 sleffy joined
04:05 carlosda1 joined
04:05 ubsan_ joined
04:06 takle joined
04:07 <sleffy> Why does Haskell infer a type of `t0 -> t1` for `(foo %)` while not attempting to infer a partially applied type for `(%) foo`?
04:07 <sleffy> Rephrasing: why does Haskell assume that the result of `(foo %)` is a function which takes at least one argument?
04:08 Xanather joined
04:09 alibabzo joined
04:09 <Koterpillar> :t (%)
04:09 <lambdabot> Integral a => a -> a -> Ratio a
04:09 BlueRavenGT joined
04:09 kellytk left
04:09 <Koterpillar> sleffy: % has that type, you gave it one argument
04:10 <geekosaur> do you know about sections?
04:10 <sleffy> Koterpillar, the (%) in Data.Ratio does. I was defining my own (%) for a DSL when this came up
04:10 <sleffy> Which had a rather funny polyvariadic function hack type signature
04:10 <c_wraith> Ah. see, that polyvariadic hack would be why
04:10 <geekosaur> that's not going to work well for operators
04:10 <sleffy> When I used `(%) foo` it worked just fine, and inferred the correct type
04:10 <geekosaur> you invoked section syntax, which assumes dyadic operators
04:10 <c_wraith> sections get desugared as using two arguments
04:10 <sleffy> But when I used `(foo %)`, the fact that it was a section made Haskell assume the resulting value was typed as some sort of function
04:11 <sleffy> aaaaah
04:11 <sleffy> So `(foo %)` desugars to `\x -> foo % x`
04:11 <sleffy> Makes sense!
04:11 <c_wraith> there used to be an extension that changed that behavior.
04:11 anishathalye joined
04:11 <c_wraith> Is that still around?
04:13 <c_wraith> sleffy: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#postfix-operators
04:13 takle joined
04:13 <sleffy> Neat! Thanks!
04:14 jer1 joined
04:15 m3adi3c joined
04:16 <Squarism> i asked a vague question before and got an answer on the opposite case. Is there a channel type that has many senders and one listener? Ie, all senders use same chan value?
04:16 <c_wraith> Squarism: Chan itself handles that fine...
04:16 <Squarism> oh ok
04:17 flatmap13 joined
04:19 BartAdv joined
04:20 steeze joined
04:21 <anishathalye> reload
04:24 sleffy joined
04:24 Guest6344 joined
04:26 fakenerd joined
04:27 anishathalye left
04:28 anishathalye joined
04:28 forgottenone joined
04:29 Sh4rPEYE joined
04:29 flatmap13 joined
04:29 takle joined
04:30 wroathe joined
04:30 blender joined
04:31 jer1 joined
04:35 mmachenry joined
04:36 fragamus joined
04:37 biglambda joined
04:39 takle joined
04:40 gcross_ joined
04:41 meba joined
04:44 mda1 joined
04:44 anishathalye joined
04:45 anishathalye joined
04:46 abhiroop joined
04:47 Sose_ joined
04:49 YongJoon joined
04:49 aarvar joined
04:51 insitu joined
04:52 bhiliyam joined
04:52 mda1 joined
04:53 user21 joined
04:53 jer1 joined
04:53 Sh4rPEYE joined
04:54 m3adi3c joined
04:55 abhiroop joined
04:56 sgfltx joined
05:01 zcourts joined
05:02 osa1 joined
05:03 vlatkoB joined
05:05 sleffy joined
05:05 danvet joined
05:06 carlosda1 joined
05:06 forgottenone joined
05:07 safe joined
05:11 <sleffy> Anyone know operator precedence values for infix type constructors? I want to know (->) in particular.
05:12 <glguy> sleffy: Try: :info (->)
05:12 hazyPurple_ joined
05:12 <geekosaur> I think (->) is a special case though
05:12 <sleffy> glguy, GHCi gives nothing :/
05:12 <glguy> GHCi says infixr 0 `(->)`
05:12 <geekosaur> not here :/
05:12 <sleffy> huh, not in my GHCi
05:12 <geekosaur> probably added in 8.x
05:12 <glguy> Time to update
05:13 <jle`> is there a foldlM
05:13 <jle`> '
05:13 <sleffy> I could've sworn I had 8.whatever
05:13 <jle`> * foldM'
05:13 <geekosaur> :t foldM
05:13 <lambdabot> (Monad m, Foldable t) => (b -> a -> m b) -> b -> t a -> m b
05:13 <jle`> i wonder if that would even make sense
05:13 jer1 joined
05:13 <geekosaur> oh, with prime, not so far as I know
05:13 <geekosaur> :t foldM'
05:13 asthasr joined
05:13 <lambdabot> error:
05:13 <lambdabot> • Variable not in scope: foldM'
05:13 <lambdabot> • Perhaps you meant one of these:
05:14 <sleffy> Ah yep, my local stack GHCi is 8.0.2 and it gives infixr 0 (->)
05:14 <geekosaur> I suspect it would be dominated by strictness of (>>=) anyway?
05:14 <jle`> i suppose i could go trough the foldl library
05:15 <Koterpillar> jle`: yes, you want a strict version of your monad/transformer
05:15 <Koterpillar> not of fold
05:15 <jle`> even if i used Identity
05:16 <jle`> wouldn't nothing get evaluated until the end?
05:17 <jle`> i have to force >>= somehow
05:18 <Koterpillar> hmm, yes
05:19 <glguy> jle`: What about Identity?
05:19 <jle`> that's a "strict" monad, but foldlM would still build up thunks
05:19 trudyjane joined
05:19 <glguy> > undefined >>= \_ -> Identity "not strict"
05:19 <lambdabot> Identity "not strict"
05:19 <jle`> welp
05:19 <glguy> It's a newtype
05:20 <glguy> You need the data Identity for it to be strict
05:20 <Squarism> im willing to pay $100 for someone experianced do a code review on my 8k line "near enterpise" gaming app. =D. Im a haskell noob since 1 year. Someone experiance in haskell Web/Threading/Database-IO. In particular i would like feedback on how i could make code more clear / concise. If monad transformers would been better to use. Its completely undocumented.
05:21 filterfish joined
05:21 <Squarism> Some experiance in ... is required! =D
05:24 nicknovitski joined
05:25 mmn80 joined
05:25 zcourts_ joined
05:26 takle joined
05:28 trudyjane joined
05:30 saurabhnanda joined
05:31 zcourts joined
05:31 saurabhn_ joined
05:31 joekarma joined
05:31 blender joined
05:34 jer1 joined
05:34 eiGHttt joined
05:38 xtreak joined
05:38 darjeeling_ joined
05:38 ggVGc joined
05:39 mbuf joined
05:39 insitu joined
05:40 <sleffy> Is there a nice, simple way to get `local`, but with `StateT`?
05:41 <sleffy> I do need `StateT`. I need to be able to modify this state, but I also want to run local computations in it, reader-style. Is there a better way than `get`-ing, preserving that value, and then `put`-ing after the computation is done?
05:42 <jle`> sleffy: looks like just gets
05:43 zcourts_ joined
05:43 <sleffy> jle`, mm, no, I don't think so. `gets` lets me select a portion of the state, but I want to select a portion of the state and then use that to run a monadic computation with that state, and then jump back to execution with the previous state
05:43 <sleffy> I guess I could just insert an extra `runState` in there...
05:44 <jle`> sleffy: yes, that's what i mean
05:44 <jle`> :t gets . evalState
05:44 <lambdabot> MonadState s m => State s a -> m a
05:44 <jle`> since you throw away the final state anyway
05:44 <sleffy> Works for me! Thanks.
05:45 <jle`> no problem!
05:47 jimmyrcom joined
05:48 splanch joined
05:48 benl23 joined
05:48 CAD97 joined
05:49 takle joined
05:49 fizruk joined
05:49 <CAD97> pl \predicates -> \match -> foldr (||) False (map ($ match) predicates)
05:49 <CAD97> no?
05:50 <CAD97> I don' t know how to IRC
05:50 fakenerd_ joined
05:50 <glguy> foldr (||) False is or
05:50 <glguy> or with map is any
05:51 baldrick1 joined
05:51 <glguy> any ($ match) predicates
05:51 juhp joined
05:51 ThomasLocke joined
05:51 ThomasLocke joined
05:52 jhrcek joined
05:53 jimbeemer10 joined
05:53 biglambda joined
05:54 <jle`> they have vanished into the air
05:54 fakenerd joined
05:54 jer1 joined
05:55 splanch joined
05:56 filterfish joined
05:56 mstruebing joined
05:56 thunderrd joined
05:56 jimbeemer10 joined
05:56 takle joined
05:57 fakenerd_ joined
06:01 CoderPuppy joined
06:02 xall joined
06:03 splanch joined
06:05 ofdm joined
06:06 mikecaruso1 joined
06:06 carlosda1 joined
06:09 peterbec` joined
06:09 fakenerd joined
06:09 raichoo joined
06:10 patbecich joined
06:11 hurkan joined
06:11 insitu joined
06:11 indi_ joined
06:12 takuan joined
06:12 wroathe joined
06:13 indi_ joined
06:13 <ReinH> oh no
06:15 insitu joined
06:15 razi1 joined
06:15 jer1 joined
06:16 cpape joined
06:18 quchen joined
06:18 augur joined
06:19 fakenerd joined
06:19 malt3 joined
06:20 zeroed joined
06:20 patbecich joined
06:20 indi_ joined
06:20 splanch joined
06:21 jer1 joined
06:21 dfeuer joined
06:22 splanch_ joined
06:22 edsko joined
06:25 takle joined
06:25 fakenerd_ joined
06:26 juhp joined
06:26 edmundsecho joined
06:26 ploop joined
06:27 connrs joined
06:28 seagreen joined
06:28 forgottenone joined
06:29 henriksod joined
06:31 matt179 joined
06:31 Gurkenglas_ joined
06:32 blender joined
06:33 thc202 joined
06:35 ludat joined
06:36 zeroed joined
06:36 jer1 joined
06:38 takle joined
06:38 indi_ joined
06:39 mstruebing joined
06:41 orhan89 joined
06:41 meba joined
06:45 benl23 joined
06:45 takle joined
06:46 dmwit_ joined
06:48 splanch joined
06:48 ogrady joined
06:48 dogukan joined
06:48 <dogukan> hi
06:48 leifmetcalf joined
06:48 dhil joined
06:49 jle` joined
06:49 jle` joined
06:49 splanch_ joined
06:51 <dogukan> i am trying to write a haskell function that takes an string and converts it to an recursive variable, for e.g. my recursive variable is defined as data Tree a = Leaf a | Branch a (Tree a) (Tree a), and when i give "Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)" to my function, i want to return variable Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)
06:51 skeuomorf joined
06:51 splanch__ joined
06:52 jrslepak joined
06:52 Xanather_ joined
06:52 bhiliyam joined
06:53 <dogukan> but actually, i do not have any idea to how to do that, if you guys have an opinion, i want to hear, I am new to haskell :)
06:53 KorriX joined
06:53 takle joined
06:54 <dfeuer> How can I profile something in a monadic context? (in this case, GHC's SimplM, which is probably some kind of enriched IOish type)
06:54 lavalike_ joined
06:54 <jle`> dogukan: it's pretty straightforward with parser combinators
06:55 <dfeuer> Where do I put the cost center?
06:55 bollu joined
06:55 <jle`> dogukan: but that's usually a late-beginner concept
06:55 MitchW joined
06:56 <pacak> dogukan: read?
06:56 <dogukan> jle`: thank you, i will look to parser combinators
06:56 <jle`> ah yeah, the default Read instance should generate the code
06:56 <jle`> if you want a quick solution, just derive Read
06:57 <dfeuer> But use readMaybe or something rather than read.
06:57 <jle`> it's not a flexible solution, but it's useful for development purposes
06:57 <dfeuer> Look in Text.Read
06:57 <dogukan> oh, i was about to ask "read what?" :D
06:57 <jle`> it pretty much has to take input exactly like waht you wrote (with extra whitespace)
06:57 <pacak> :t read
06:57 <lambdabot> Read a => String -> a
06:57 ubsan_ joined
06:58 <jle`> so it's useful for development, but probably not for actual flexible applications
06:58 guiben joined
06:58 <pacak> > read (Just (Just (Left 4)) :: Maybe (Maybe (Either Int ()))
06:58 <jle`> dogukan: data Tree a = Leaf a | Branch a (Tree a) (Tree a) deriving (Show, Read)
06:58 <lambdabot> <hint>:1:60: error:
06:58 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
06:58 <pacak> > read "(Just (Just (Left 4))" :: Maybe (Maybe (Either Int ()))
06:58 <lambdabot> *Exception: Prelude.read: no parse
06:58 <cocreature> dfeuer: I’m not sure I understand your question. just put the cost centres on the things you’re interested in?
06:58 <pacak> > read "Just (Just (Left 4))" :: Maybe (Maybe (Either Int ()))
06:58 <lambdabot> Just (Just (Left 4))
06:58 <jle`> @let data Tree a = Leaf a | Branch a (Tree a) (Tree a) deriving (Show, Read)
06:58 <lambdabot> .L.hs:219:25: error:
06:58 <lambdabot> Ambiguous occurrence ‘Tree’
06:58 <lambdabot> It could refer to either ‘Data.Tree.Tree’,
06:58 <jle`> aw
06:58 <mauke> @let data MyTree a = Leaf a | Branch a (Tree a) (Tree a) deriving (Eq, Ord, Show, Read)
06:58 <lambdabot> .L.hs:220:29: error:
06:58 <lambdabot> • No instance for (Ord (Tree a))
06:58 <lambdabot> arising from the second field of ‘Branch’ (type ‘Tree a’)
06:58 <mauke> @let data MyTree a = Leaf a | Branch a (MyTree a) (MyTree a) deriving (Eq, Ord, Show, Read)
06:59 <lambdabot> Defined.
06:59 <mauke> > read "Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)" :: MyTree Integer
06:59 <lambdabot> Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)
06:59 takuan joined
06:59 lavalike joined
06:59 jer1 joined
07:00 mstruebing joined
07:00 <dogukan> oh, this is the best irc channel i have ever seen :D
07:00 inr_ joined
07:00 <pacak> dogukan: It will hapilly explode in your face if something is not matching.
07:00 epsilonhalbe joined
07:00 <dfeuer> cocreature: I jus tdon't have a clear sense of what that ends up meaning. Do I end up seeing the cost of *calculating* actions, or of *executing* them?
07:00 <pacak> dogukan: And will kill your program with "Prelude.read: no parse"
07:00 augur joined
07:01 <jle`> > readMaybe "Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)" :: Maybe (MyTree Integer )
07:01 takle joined
07:01 <lambdabot> error:
07:01 <lambdabot> • Variable not in scope:
07:01 <lambdabot> readMaybe :: [Char] -> Maybe (MyTree Integer)
07:01 <jle`> @let import Text.Read
07:01 <lambdabot> Defined.
07:01 <jle`> > readMaybe "Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)" :: Maybe (MyTree Integer)
07:01 <lambdabot> Just (Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6))
07:01 epsilonhalbe left
07:01 <jle`> > readMaybe "Brach 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)" :: Maybe (MyTree Integer)
07:01 <lambdabot> Nothing
07:01 <cocreature> dfeuer: hm good point. in my experience, it always seemed to be the cost of the execution but I never really thought about it, sry
07:02 <dfeuer> cocreature: you may well be right. I just don't have enough of a clue.
07:02 eklavya_ joined
07:02 Itkovian joined
07:02 raichoo joined
07:02 alfredo joined
07:02 <jle`> dogukan: but if you wanted to write it from scratch, parser combinators would make it simple. 'deriving Read' actually uses parser combinators behind the scenes to generate the 'read' function in a composable way
07:03 <pacak> :t reads
07:03 <lambdabot> Read a => ReadS a
07:03 kritzcreek joined
07:03 <cocreature> dfeuer: one thing to keep in mind is that CPSed monads tend to attribute the whole do-block to the first action and so on which can be quite confusing (not sure if that applies to SimplM)
07:03 fakenerd joined
07:04 <dogukan> ok then, thank you guys, i appreciate your help
07:04 <jle`> parseTree = parseLeaf <|> parseBranch; parseLeaf = Leaf <$> (string "Leaf" *> parseThing); parseBranch = Branch <$> (string "Branch" *> parseThing) <*> parseTree <*> parseTree
07:04 <jle`> is more or less the entire parser written using parser combinators
07:04 <jle`> aside from whitespace handling
07:04 erikd joined
07:05 AfC joined
07:05 <tsahyt> wouldn't you need some combinator for parentheses there too?
07:05 <dfeuer> cocreature: thanks. I doubt it's CPSey, but I should check.
07:05 <jle`> ah yes
07:07 carlosda1 joined
07:09 pavonia joined
07:10 fakenerd joined
07:10 takle joined
07:12 vlatkoB_ joined
07:12 balor joined
07:16 fakenerd_ joined
07:18 splanch joined
07:19 jer1 joined
07:21 patbecich joined
07:22 takle joined
07:23 MoALTz joined
07:24 iomonad joined
07:25 fizruk joined
07:25 indi_ joined
07:26 blender joined
07:27 tlevine joined
07:29 tomphp joined
07:29 raichoo joined
07:30 bennofs joined
07:31 detrumi joined
07:31 <dogukan> i couldn't even get your codes working on hugs, it is so hard for me to get used to haskell :D
07:31 ertes joined
07:31 <liste> hugs? what is this, 1999?
07:32 mjora7 joined
07:32 <dogukan> :D
07:32 mstruebing joined
07:32 ertes joined
07:33 mstruebing joined
07:34 connrs joined
07:34 indi_ joined
07:34 <mniip> do not use hugs
07:35 <liste> ^ that
07:35 albertid joined
07:35 <mniip> it's been unmaintained for years
07:35 ixxie joined
07:36 <mniip> you wouldn't use Turbo C would you
07:36 <Rembane> Challenge accepted!
07:37 uglyfigurine joined
07:37 <dogukan> i prefer gcc :P
07:37 takle joined
07:37 <mniip> right, likewise you should prefer a modern tool like ghc
07:39 biglama joined
07:40 jer1 joined
07:40 aarvar joined
07:41 bvad joined
07:41 orhan89 joined
07:41 marr joined
07:44 ragepandemic joined
07:44 takle joined
07:46 <jle`> there are so many things wrong with using hugs today
07:46 <jle`> all up and down the toolchain
07:48 laz joined
07:50 biglambda joined
07:52 indi_ joined
07:53 ventonegro joined
07:53 <dogukan> i found an online ghc compiler, now i am working on that instead of hugs :P
07:53 takle joined
07:53 soniku joined
07:54 michielb joined
07:54 <tsahyt> why not just use ghci if you want a repl?
07:55 leifmetcalf joined
07:55 <dogukan> i do not have sufficient permissions to install anything to the computer that i am currently working on
07:56 xtreak joined
07:57 xintron joined
07:58 castlelore joined
07:58 castlelore joined
07:59 Sampuka joined
08:00 xtreak joined
08:00 Axman6 joined
08:00 indi_ joined
08:01 jer1 joined
08:03 xormor joined
08:05 tennix joined
08:05 <xormor> should Haskell suffice as a language for me to use as a mathematics studying aid?
08:05 mstruebing joined
08:06 sepp2k joined
08:07 <jle`> suffice in what way
08:07 msks joined
08:07 <jle`> that you won't need to learn any other programming languages?
08:07 Itkovian joined
08:08 blender joined
08:08 carlosda1 joined
08:08 <Axman6> xormor: depends what sort of mathematics I guess
08:08 tomphp joined
08:09 chichou joined
08:09 <mivael> hello
08:09 <jle`> hello mivael
08:09 Sigyn joined
08:10 <mivael> Could someone please explain what "Some" part means in "data Map k v = IntMap (Some k v)" in the Data.HashMap description? (http://hackage.haskell.org/package/hashmap-1.3.2/docs/Data-HashMap.html)
08:10 Yuras joined
08:11 <xormor> Axman6, I am thinking of counting equations - derivatives and then integrals as I have learned them.
08:11 <Axman6> what's the definition of Some?
08:12 <MVQq> mivael: just looks like a stand-in for some type
08:13 <mauke> data Some k v = Only !k v | More !(M.Map k v) deriving (Eq, Ord)
08:13 <mauke> says the source
08:13 <mauke> it's an internal type
08:13 <MVQq> welp that's me being wrong :>
08:13 <Axman6> if you want a hashmap you should look at the unordered-containers package btw
08:13 eyck joined
08:13 <dogukan> i coulnd't get it working, i wrote this https://pastebin.com/RqKRkbuS but ghc gives "parse error (possibly incorrect indentation or mismatched brackets)" at lines 2 and 9
08:13 <Axman6> hashmap is quite old
08:14 <tsahyt> mivael: either a hash maps to exactly one element, or there is a hash collision, which needs to be resolved somehow. It does that by storing a Map of values that all have the same hash
08:14 castlelore joined
08:14 castlelore joined
08:14 <jle`> dogukan: what's line 7 doing there?
08:14 <tsahyt> mivael: that's what the Some type here is for
08:14 edmundsecho joined
08:14 <jle`> you can only put declarations/definitions in haskell files
08:14 <jle`> stray expressions don't really make sense :o
08:14 m_ joined
08:15 <jle`> (at the top level, at least)
08:15 m_ left
08:15 xtreak joined
08:15 <jle`> dogukan: also you don't need the type annotation on line 9
08:15 xtreak joined
08:15 <jle`> 'fringe (read "...")` should be fine
08:16 <jle`> oh wait i guess you do need the type annotation
08:16 <jle`> anyway, once you get rid of line 7, the syntax errors should go away
08:16 <jle`> then you just have a type error...you want print (fringe (read "..." :: MyTree Integer))
08:16 sproingie joined
08:17 seagreen joined
08:18 <dogukan> jle`: thanks again!
08:18 <jle`> no problem!
08:18 <dogukan> :D
08:19 richi235 joined
08:19 eyck joined
08:19 <dogukan> is there a way to do this without type annotation?
08:20 <dogukan> forcing it to :: MyTree Integer
08:20 lep-delete joined
08:20 <jle`> the problem is that haskell needs a way to know that you want to read in Integers
08:20 <jle`> and not, say, Bools or ()s
08:20 mjora7 joined
08:21 <jle`> you could annotate the result of fringe, print (fringe (read "..") :: [Integer])
08:21 matt179 joined
08:21 <jle`> if you're in ghc 8+, like you should be, you can also use type applications
08:21 jer1 joined
08:21 <jle`> `main = print (fringe @Integer (read "..."))`
08:22 jdt joined
08:22 <jle`> the @Integer there says "use fringe with 'Integer' filled in for the type variable 'a'"
08:22 <jle`> you'd need to add {-# LANGUAGE TypeApplications #-} to the top of your file
08:22 chipp joined
08:24 <mniip> read @Integer
08:24 <mniip> seems to be more canonical
08:24 <jle`> it would have to be read @(MyTree Integer)
08:24 takle joined
08:24 <mniip> ah
08:24 <mniip> I thought we're reading integers
08:25 <mauke> > read @(MyTree Integer) "Branch 5 (Branch 10 (Leaf 2) (Leaf 3)) (Leaf 6)"
08:25 <lambdabot> error:
08:25 <lambdabot> Pattern syntax in expression context: read@(MyTree Integer)
08:25 <lambdabot> Did you mean to enable TypeApplications?
08:25 <mauke> aww
08:25 <jle`> :')
08:25 <jle`> * :'(
08:25 <mniip> @let {-# LANGUAGE TypeApplications #-}
08:25 <lambdabot> Defined.
08:25 <MVQq> canonical? it's brand new :>
08:25 <mniip> I bet that doesn't work though
08:25 <mniip> :t id @Int
08:25 <lambdabot> error:
08:25 <lambdabot> Pattern syntax in expression context: id@Int
08:25 <lambdabot> Did you mean to enable TypeApplications?
08:25 <jle`> i've tried that before, but it seems like lambdabot just adds a comment to L.hs
08:25 <mniip> well yes
08:25 <cocreature> :set -XTypeαpplications
08:25 <jle`> it doesn't move it to the top of the file :(
08:25 somewone joined
08:25 <cocreature> I can’t even type
08:26 patbecich joined
08:26 <mivael> Axman6, thank you for mentioning unordered-containers! Looks like something I was looking for.
08:26 <MVQq> lambdabot doesn't to typeapps due to overlapping syntax concerns
08:26 <mniip> well, enabling arbitrary extensions could lead to bad things
08:26 <jle`> @let -- hello everyone
08:26 <lambdabot> Defined.
08:26 makalu joined
08:26 <mniip> there was a command...
08:26 <jle`> @let {-# LANGUAGE NoSafe #-}
08:26 <lambdabot> Defined.
08:26 halogenandtoast joined
08:26 earldouglas joined
08:27 <makalu> it seems that there is no library for writing tls websocket servers? There's wuss for clients and the websockets library supports non-encrypted websockets but what about servers?
08:27 <halogenandtoast> Does anyone know how to filter params in Yesod's logging. I'd like password not to show up.
08:27 <jle`> makalu: is the problem with 'websockets' that it's unencrypted?
08:27 merijn joined
08:27 <makalu> jes
08:28 <makalu> yes* sorry
08:28 <cocreature> makalu: iirc you can just use the websockets library in combination with warp-tls
08:28 Boomerang joined
08:29 <Axman6> halogenandtoast: as in URL params? you should never have password in URL params...
08:29 chichou joined
08:29 fvgs joined
08:29 mattyw joined
08:29 <mniip> I guess not
08:29 <mniip> well, there is http://silicon.int-e.eu/lambdabot/State/Pristine.hs
08:29 <mniip> but that's not the L.hs
08:30 jer1 joined
08:30 <jle`> :t cata
08:30 <lambdabot> Functor f => (f a -> a) -> Mu f -> a
08:31 indi_ joined
08:31 ccomb joined
08:31 <fvgs> Any macOS users here who successfully installed ghc via Homebrew?
08:31 takle joined
08:31 guiben joined
08:32 <merijn> fvgs: No, I generally just install the binary release of GHC and build cabal with that
08:32 <vaibhavsagar> mniip: is there a joke I'm not getting here?
08:32 <Axman6> I just use stack to install GHC
08:32 <fvgs> merijn: Do you mean this one? https://www.haskell.org/ghc/download_ghc_8_0_2#macosx_x86_64
08:32 <merijn> fvgs: There's ghcformacosx, but it doesn't seem to have a GHC 8 version
08:32 <merijn> fvgs: Yeah
08:33 <merijn> fvgs: Download, unzip read instructions (which boil down to "./configure --prefix=path/to/install && make install") and it works
08:33 <dogukan> thanks everyone for helping me, i started to understand haskell :)
08:33 <fvgs> I expected Homebrew to install a bottled version, but now it's compiling it from source which supposedly takes hours
08:33 <dogukan> (finally)
08:33 <fvgs> merijn: is it relatively quick?
08:33 <MVQq> oh it really shouldn't take hours :>
08:34 <merijn> fvgs: Yes, like...seconds
08:34 fendor joined
08:34 juhp joined
08:34 <merijn> fvgs: It's a binary, it's already compiled, it's just copying stuff to the right paths
08:34 Swizec joined
08:34 <quchen> fvgs: You’re a beginner, right? Use Stack! (Others have probably suggested this before, so here I am adding emphasis.)
08:34 <merijn> fvgs: Of course you need to make sure the prefix you specify is actually on your path, but other than that :)
08:34 <fvgs> As I'd expect. I just don't understand why Homebrew doesn't do that... the Homebrew formula even downloads the binary
08:35 <fvgs> but then proceeds to compile from source
08:35 <merijn> fvgs: Well, they need a binary to compile the source :p
08:35 dogukan left
08:35 <merijn> fvgs: Since GHC is written in Haskell you can't compile it without GHC :p
08:35 <halogenandtoast> Axman6: no it was in post params
08:35 <merijn> fvgs: No clue why they do that
08:35 <halogenandtoast> POST /auth/page/emailRegister/register
08:35 <halogenandtoast> Params: [("_token","SyIeBitRXJ"),("email","halogenandtoast@gmail.com"),("password","password")]
08:35 <merijn> There's also stack, which I've stubbornly refused to learn, so I can't tell you how to do that :p
08:36 eyck joined
08:36 <chichou> what's wrong with homebrew ghc? I'm a beginner and have it installed, it's working well so far for me :-)
08:36 <fvgs> merijn: Right, I figured that's why they download it. But I would rather it manage the binary package instead of compiling from source xD
08:36 <merijn> chichou: Nothing wrong per se, except they compile for source for no particular reason
08:36 <quchen> curl -sSL https://get.haskellstack.org/ | sh
08:36 <quchen> Done
08:36 <* merijn> smacks quchen
08:36 <quchen> inb4 oh noes pipe to shell
08:36 <fvgs> I have looked into stack. I was asking about stack vs cabal, etc. here yesterday
08:36 binarin joined
08:36 <merijn> Don't teach people to pipe to shell >.<
08:36 <quchen> fvgs: I remember.
08:36 <chichou> oh yeah it took a while to install I reckon
08:37 <merijn> chichou: So if you've already got it setup. Leave it, but I wouldn't recommend wasting a few hours compiling if you don't have it yet :)
08:37 <makalu> cocreature: yeah jaspervdj says in a reddit comment that websockets should be used with warp. I'll have to find out how. Thanks.
08:37 <chichou> merijn: thanks :)
08:37 <quchen> fvgs: If piping to shell isn’t your cup of tea then there are also manual download links, https://docs.haskellstack.org/en/stable/install_and_upgrade/#linux
08:37 <cocreature> makalu: there is a websockets-wai package or something like that
08:38 <quchen> fvgs: Once you have stack in your $path your problems are probably all gone. Stuff is loaded automatically into the right places (inside ~/.stack) and all that.
08:38 <makalu> cocreature: nice thanks!
08:38 <merijn> fvgs: Opinions are divided. Some people claim stack is the messiah solving all your dependency problems. Others (i.e. me) don't really seem to run into too many issues with cabal and, since I already know cabal, I'm too lazy and curmudgeony to invest time into figuring out stack :p
08:38 <quchen> No fiddling with libs and so on.
08:38 <merijn> Also, stack seems to involve way too much typing of "stack <command>"
08:39 <quchen> Cabal seems to involve way too much typing of »cabal <command>«
08:39 <quchen> GHC seems to involve way too much typing of »ghc <command>«
08:39 <mniip> vaibhavsagar, I don't think so?
08:39 <fvgs> I was semi sold on stack yesterday, but after reading through many of the features in the docs I feel like maybe it tries to do too much
08:39 <quchen> When I tell Stack to profile, it profiles.
08:40 <fvgs> And cabal seemed like more my cup of tea
08:40 marr joined
08:40 <quchen> When I tell Cabal to profile, it tells me the libs aren’t there and I should rebuild with profiling, which I then have to figure out how to do.
08:40 qzo joined
08:40 <merijn> quchen: Not if you just update your .cabal/config once and be done with it :p
08:40 <vaibhavsagar> mniip: is that the lambdabot Prelude equivalent?
08:40 <mniip> it is
08:41 <mniip> it is used to initialize L.hs
08:41 <mniip> which is appended with whatever people give to @let
08:41 <vaibhavsagar> I thought it might be a parody of the average Haskell source file
08:41 <fvgs> any experience with installing stack via homebrew?
08:41 <fvgs> it claims ghc and cabal-install as build dependencies
08:41 <vaibhavsagar> 1 page of language extensions, 2 pages of imports, 3 one liner function definitions
08:42 <merijn> fvgs: FWIW, if you like having a more minimalist setup with cabal it works just fine for me and many others :)
08:42 <Axman6> I think installinmg stack via homebrew is the recommended method
08:42 mthek joined
08:42 <vaibhavsagar> I don't know the fact that it's legitimate makes me happy or sad
08:42 <Axman6> that might not be true any more though
08:42 somewone joined
08:42 pikhq joined
08:43 <vaibhavsagar> homebrew seems to have the latest version of stack fwiw: https://github.com/Homebrew/homebrew-core/blob/master/Formula/haskell-stack.rb
08:43 <fvgs> the things is I also value reasonable package management. which is why my preference would have been to install ghc and cabal via homebrew
08:43 oisdk joined
08:43 <fvgs> but the installing ghc part is insane
08:43 takle joined
08:43 <mniip> vaibhavsagar, 2 pages of imports, but count how many pages of code have people evaluated in here
08:43 xtreak joined
08:43 somewone joined
08:43 orhan89 joined
08:44 <fvgs> so that just leaves installing the haskell platform cask or stack via homebrew
08:44 mero joined
08:44 <vaibhavsagar> mniip: lambdabot is incredibly useful, no argument there
08:44 terrorjack joined
08:44 <vaibhavsagar> fvgs: have you looked into Nix?
08:44 <mniip> I count 31 kloc
08:44 <terrorjack> Is it possible to use template haskell to "summon" unexported data constructors so I can derive a Show instance for a type?
08:44 <MVQq> "<quchen> When I tell Cabal to profile, it tells me the libs aren’t there and I should rebuild with profiling, which I then have to figure out how to do." sounds like you might like new-build, e.g. cabal new-build --enable-profiling
08:44 <merijn> fvgs: Well, the nice part of the ecosystem is that GHC nicely separates it's package databases by version, so multiple versions never override each other. Cabal is backwards compatible, so newer cabal's work with older GHCs. So I just install multiple binary versions of GHC and switch by changing my path and it "just works" for me
08:45 <fvgs> vaibhavsagar: I have in the past, haven't tried it on macOS though
08:45 <Axman6> terrorjack: you may be able to do it with Generic I think
08:45 <mniip> 37 kloc with -beginners
08:45 <ertes> someone mentioned an apt source for debian (and potentially ubuntu) that provides up-to-date versions of GHC and cabal-install… does anyone know which one it was?
08:45 <quchen> ertes: Probably hvr’s repo?
08:45 <merijn> ertes: hvr's ppa, but I dunno the URL
08:45 <ertes> thanks
08:45 <quchen> ertes: https://launchpad.net/~hvr/+archive/ubuntu/ghc
08:45 Swizec joined
08:46 takle joined
08:46 <fvgs> does stack's ghc lag behind the stable release?
08:46 Swizec joined
08:46 <Axman6> no
08:46 <jle`> stack doesn't "have" a ghc
08:46 <Axman6> it just downloads the official binary
08:47 <merijn> fvgs: Not significantly, I think. More importantly, I would advise beginners to lag GHC stable releases :p
08:47 <quchen> Nightly builds are up-to-da(y|te), LTS releases are usually a couple of months behind.
08:47 <Axman6> it's alkready possible to use stack with GHC 8.2.1 RC
08:47 <merijn> fvgs: I generally recommend "current version - 1" of GHC for beginners
08:47 Swizec joined
08:47 <fvgs> merijn: why?
08:47 <terrorjack> Axman6: but the type doesn't has Generic instance either, and without constructors in scope it can't be derived
08:47 <merijn> fvgs: Bleeding edge leads to lot of breakage, so older GHCs have better ecosystem support
08:47 <Axman6> merijn: except on macOS where you need 8.0.2 because Apple broke things
08:48 <jle`> stackage snapshots are associated with ghc's; the nightlies follow stable releases, and LTS lags behind a few months as mentioned
08:48 Swizec joined
08:48 <jle`> but the stack tool itself doesn't endorse a particular ghc version
08:48 <Axman6> terrorjack: this sounds like you're trying to solve a problem you're not supposed to be able to solve ;)
08:48 <merijn> fvgs: Additionally, most new features in GHC are "advanced" features, which beginners aren't generally needing :)
08:48 <fvgs> merijn: But stable release by definition shouldn't be bleeding edge
08:48 biglama joined
08:48 <Axman6> if you "need" show, make a function Foo -> String
08:48 <cocreature> 8.0.2 can hardly be called bleeding edge at this point
08:48 <jle`> terrorjack: http://hackage.haskell.org/package/true-name
08:48 <merijn> fvgs: stable release is "stable", not containing to many bugs, it's NOT necessarily backwards compatible
08:49 Swizec joined
08:49 <merijn> fvgs: Libraries might need to be patched/updated, which can take a few months after release
08:49 <merijn> cocreature: Sure, but we're nearing 8.2 release, so it's about time to switch to 8.0 as "current - 1" ;)
08:49 <cocreature> fair enough
08:49 <merijn> fvgs: I usually only upgrade GHC when 1) I need a new feature or 2) I run into a blocking bug
08:50 <jle`> by the time LTS adopts a ghc version, enough of the ecosystem has moved forward to make it a justifiable decision to move up i think at least
08:50 <cocreature> I tend to recommend to switch once .2 is out
08:50 <merijn> Axman6: What was broken on macOS? I was using 7.10.3 up until a month or so ago
08:50 <cocreature> merijn: are you as good at upgrading macOS as you are at upgrading ghc? :)
08:50 <merijn> cocreature: Yes, for much the same reason :p
08:51 <cocreature> iirc it was only a problem with newer versions
08:51 <merijn> Actually...
08:51 tomphp joined
08:51 <merijn> I just remembered I didn't update macOS yet :p
08:51 <merijn> Still on Yosemite, rather than Sierra, since I like other to suffer the pain of bugfixing for me :p
08:51 takle joined
08:52 <merijn> See! It's sound life advice!
08:52 <merijn> Always lag on non-security updates!
08:52 fakenerd joined
08:53 <fvgs> Can't argue with that. I updated from macOS 10.12.3 to 10.12.4 and it broke my monitor setup. Been complaining to Apple for weeks to get a fix...
08:53 bhiliyam joined
08:54 <fvgs> what version of ghc does stack ghc run?
08:54 orhan89 joined
08:54 <fvgs> brew install ghc has been running for over an hour now while it compiles the source. So I'm getting ready to ctrl+c it and either install the platform or stack
08:54 <sophiag> shouldn't i be able to pattern match with exponentials on both sides using ViewPatterns and/or TypeApplications? i'm running into trouble here: http://lpaste.net/354750
08:54 indi_ joined
08:54 soniku joined
08:55 Dr8128 joined
08:56 <halogenandtoast> Does anyone know how to filter params in Yesod's logging. I'd like password not to show up. Currently looks like: `Params: [("_token","SyIeBitRXJ"),("email","halogenandtoast@gmail.com"),("password","password")]`
08:56 mmn80 joined
08:56 m` joined
08:56 <mauke> sophiag: you can't deconstruct functions
08:57 jer1 joined
08:57 fakenerd_ joined
08:57 <jle`> sophiag: do you think that '->' is a constructor?
08:57 <jle`> oh, it's VIewPatterns
08:58 <mauke> not really
08:58 <jle`> er
08:58 <sophiag> mauke: what would you recommend then if i need to somehow convert between those function types? the former results from parsing ASTs and the latter is necessary to actually apply them :/
08:59 <jle`> what do you want to write?
08:59 <mauke> sophiag: depends on what you want it to actually do
08:59 splanch joined
09:00 <jle`> what does the final Bool return?
09:00 <sophiag> it's exactly like i said...i'm parsing lambdas from ASTs into the first exponential in that signature, but they're all really of the second
09:00 <sophiag> True or False
09:00 dcoutts_ joined
09:00 uuplusu joined
09:00 <sophiag> but that's not known until application
09:00 <jle`> how does it decide whether to return True or False?
09:00 <mauke> fromJustAmbVal _ = \_ -> False
09:00 <sophiag> in this case they're meant to be the predicate in filter
09:00 <mauke> there we go, that fits your type
09:00 <jle`> yes, but where does the Bool come from
09:01 <halogenandtoast> mauke: why not just const False ?
09:01 <sophiag> the bool is wrapped up in AmbVal
09:01 fakenerd joined
09:01 <sophiag> and i don't see how having it always return False helps?
09:01 <jle`> then we need to know the definition of AmbVal
09:01 MVQq joined
09:01 <jle`> mauke's point was that there really isn't any way we can know what BOol to return, from the information you've given us
09:01 <jle`> so returning False is just as good as any other guess
09:01 <halogenandtoast> sophiag: it doesn't, but it fits the amount of information we have.
09:01 <mauke> sophiag: it doesn't, but you're not telling us what you want it to do, just the type
09:02 <mauke> sophiag: so I gave you something matching that type
09:02 <jle`> "i want a function Foo -> Bool, but i won't describe what the function actually does. how do i write it?" :)
09:02 <sophiag> well, it would return true of false when applied as a predicate
09:02 <mauke> my function does that
09:02 <jle`> mauke's answer also does that
09:02 <halogenandtoast> Basically we need to know WHY it would return True or False
09:03 <sophiag> doesn't it always return False no matter what? i seem to be confused about this
09:03 <jle`> yes, when used as a predicate, it returns False
09:03 <jle`> but that's literally as good as any answer we can give you, unless you give us more information
09:03 <mauke> sophiag: what's the problem with that? your only requirements are that it should return True or False, which it does
09:03 <jle`> do you see the issue?
09:03 <sophiag> even if the data satisfies the predicate then it returns false?
09:03 Yuras joined
09:03 <mauke> sophiag: what predicate?
09:03 <sophiag> anyway, this is updated with the type of AmbVal: http://lpaste.net/354750
09:03 <jle`> what if someone came up to you and said, "i need to write an Int -> Int. it has to return an Int when applied."
09:04 <jle`> there really isn't any way you can meaningfully help them
09:04 <jle`> what predicate are you talking about?
09:04 <sophiag> (filter (\x -> x /= 0) [0,2,0,43,0,5]) /= (filter False [0,2,0,43,0,5])
09:04 takle_ joined
09:04 fakenerd_ joined
09:05 <halogenandtoast> sophiag: that's an error
09:05 <halogenandtoast> I assume you mean const False or (\_ -> False)
09:05 <halogenandtoast> but sure
09:05 <jle`> yes, they're different, but you haven't given us any reason to prefer one over the other
09:05 <sophiag> halogenandtoast: i don't understand anything about that
09:05 <halogenandtoast> this doesn't tell us WHY yet
09:05 <mauke> sophiag: what's the problem with that?
09:05 <sophiag> mauke: it doesn't actually filter out the zeros?
09:05 <jle`> sophiag: what 'predicate' are you talking about?
09:06 <mauke> sophiag: you never said anything about filtering zeroes
09:06 <jle`> sophiag: can you give us sample inputs and ouputs you want to have?
09:06 <sophiag> filter <predicate> <list>
09:06 kuribas joined
09:06 <sophiag> jle`: i just gave one. how many would you like?
09:06 <jle`> i mean, for fromJustAmbVal
09:06 <mauke> sophiag: that doesn't use AmbVal
09:06 <jle`> what are some sample inputs to fromJustAmbVal
09:06 <jle`> and some sample outputs
09:06 <halogenandtoast> jle`: I assume (\x -> x /= 0) is not an AmbVal
09:06 <sophiag> i updated the paste, as asked
09:06 <sophiag> i gave an example, as asked
09:07 <halogenandtoast> Not sure why I said jle` sorry
09:07 <jle`> can you give us an example usage of fromJustAmbVal
09:07 <halogenandtoast> sophiag: ^^
09:07 <jle`> fromJustAmbVal (????) = ????
09:07 <mauke> sophiag: you gave us an example of code that has nothing to do with AmbVal
09:07 <jle`> because we really aren't sure what fromJustAmbVal is supposed to return
09:07 <jle`> other than "a Bool"
09:07 <halogenandtoast> sophiag: Just for clarification, we're not being jerks, we literally don't know what you're trying to get at yet.
09:07 <sophiag> fromJustAmbVal $ Maybe (\x -> Just (x /= 0))
09:08 <sophiag> oops, i meant: fromJustAmbVal $ Just (\x -> Just (x /= 0))
09:08 <jle`> do you mean Just (\x -> Just (x /= 0)) ?
09:08 <halogenandtoast> sophiag: Maybe (\x -> Just (x /= 0)) is not an AmbVal
09:08 leifmetcalf joined
09:08 <jle`> sophiag: that doesn't match the type you gave us
09:08 <sophiag> how so?
09:08 <jle`> Just (\x -> Just (x /= 0)) :: Maybe (Int -> Maybe Bool)
09:08 fendoer joined
09:08 cordawyn joined
09:08 coot_ joined
09:09 <jle`> but, as you have given us fromJustAmbVal, it expects Maybe (AmbVal -> Maybe AmbVal)
09:09 carlosda1 joined
09:09 <sophiag> fromJustAmbVal $ Just (AmbVal x -> Just BoolVal (x /= 0))
09:09 fakenerd joined
09:10 <mauke> that's a syntax error
09:10 <jle`> that isn't a valid haskell function
09:10 <sophiag> err wait
09:10 <sophiag> fromJustAmbVal $ Just (CharVal x -> Just BoolVal (x /= 0))
09:10 <mjora7> I compiled a Hello world program and it's a whopping 1.7mb's. That's crazy! How is that even possible?
09:10 <mauke> that's a syntax error
09:10 <jle`> that is also not a valid haskell function
09:10 C-16 joined
09:10 <jle`> mjora7: most of it is the runtime system
09:10 <halogenandtoast> mjora7: stop caring, move on with life.
09:10 fenedor joined
09:10 <merijn> mjora7: Because now effort is taken to link a "minimal subset" of the runtime system
09:10 <mauke> after that, it's a type error
09:11 <jle`> mjora7: but, try printing hello world twice
09:11 <jle`> you'll see that the result isn't 3.4 mb :)
09:11 <mauke> merijn: s/now/no/
09:11 zcourts joined
09:11 <merijn> mauke: Typing is hard!
09:11 <mjora7> Ok I see, so there shouldn't be a much of a difference past that initial runtime system.
09:11 <mutsig_> :r
09:11 <mutsig_> oops
09:12 <sophiag> i was just asking about pattern matching for functions, but would you guys like to see the entire code or more examples or what?
09:12 <jle`> sophiag: you can't pattern match on functions
09:12 <mauke> sophiag: no, we want to understand what the hell you want this function to do
09:12 <jle`> but, if you want us to help you write fromJustAmbVal, you have to explain to us what it does
09:12 <sophiag> i did
09:12 <mauke> no, you didn't
09:12 oish joined
09:12 <sophiag> i gave several examples
09:12 <merijn> mjora7: Right. Also, by default GHC simply statically links all haskell libraries into your program, there's some stuff you can use to reduce the "bloat" that introduces, but honestly, it's not that worth it, imo
09:12 <mauke> no, you didn't
09:12 <jle`> you didn't give any examples that worked
09:12 <merijn> mjora7: Since disk space is pretty cheap
09:12 <jle`> every example you gave was a syntax error
09:12 <jle`> and also a type error
09:13 <sophiag> how so? you saw the adt
09:13 <mauke> you didn't give a single example of fromJustAmbVal
09:13 takle_ joined
09:13 <sophiag> i did above
09:13 <jle`> the ADT we understand
09:13 <jle`> fromJustAmbVal is what we don't understand
09:13 benl23 joined
09:13 <jle`> you did not give any working examples
09:13 filterfish joined
09:13 <mjora7> merijn: Yeah I don't really care about the size, I was just curious as to why it was so big, but I guess I'm comparing it to the Hello, world! C binary equivalent, which isn't fair at all.
09:13 <sophiag> <sophiag> fromJustAmbVal $ Just (CharVal x -> Just BoolVal (x /= 0))
09:13 <mauke> the one thing involving fromJustAmbVal you posted was 1) a syntax error 2) didn't include the expected result
09:13 <mauke> sophiag: SYNTAX ERROR
09:13 <jle`> sophiag: that isn't valid haskell
09:13 <jle`> we don't even know how to interpret that
09:13 <halogenandtoast> mjora7: yeah not really fair.
09:14 <jle`> mjora7: for what it's worth, C has a runtime overhead as well, it's just smaller than ghc haskell's :)
09:14 <mauke> sophiag: even if it wasn't 2 syntax errors and 2 type errors, it's still not a complete example because it doesn't include the result
09:14 <merijn> mjora7: The runtime system has GC, threading (depending on the version), semi-preemptive scheduling, etc.
09:14 Yuras joined
09:14 <jle`> sophiag: we're trying to help you, but you haven't given us a single working example :(
09:14 <mauke> sophiag: without the expected result we still don't know what you want this expression to do
09:14 <jle`> the fact that we're still talking to you know shows that we are trying to help
09:14 <sophiag> it unwraps Maybe and AmbVals
09:15 jer1 joined
09:15 <jle`> that isn't descriptive enough for us to know what you want
09:15 <jle`> you have to give us an example usage of fromJustAmbVal
09:15 <jle`> one that actually is valid haskell
09:15 <jle`> a sample input, and a sample output
09:15 fakenerd_ joined
09:15 <jle`> do you see why the example you gave isn't valid haskell?
09:15 <halogenandtoast> sophiag: keep in mind Just (CharVal x -> Just BoolVal (x /= 0)) is not valid Haskell
09:16 <sophiag> hard to keep in my mind when it's repeated by three different people several times each
09:16 jaspervdj joined
09:16 sproingie joined
09:16 sproingie joined
09:16 <jle`> we don't even know how to begin interpreting (CharVal x -> Just BoolVal (x /= 0))
09:16 <halogenandtoast> That sounds like the opposite.
09:17 <jle`> okay, i'll provide an input that is valid haskell, and can you tell me what you expect it to return?
09:17 <halogenandtoast> sophiag: please don't get angry, we're doing our best to help you with the information we have.
09:17 <sophiag> halogenandtoast: i just told you the best way you can help is not repeating something that's already been said
09:17 <jle`> what should `fromJustAmbVal (\_ -> Just (FloatVal 3.9))`
09:17 <jle`> return
09:18 <jle`> er, fromJustAmbVal (Just (\_ -> Just (FloatVal 3.9)))
09:18 augur joined
09:18 <jle`> should it return \_ -> True ?
09:18 oisdk joined
09:18 <sophiag> (\_ -> 3.9)
09:18 <jle`> that doesn't typecheck
09:18 <jle`> the result has to be Bool
09:18 <mauke> 3.9 isn't a Bool
09:18 <sophiag> right. i would never have that input
09:19 <jle`> okay
09:19 <jle`> so what input would you have?
09:19 <sophiag> it should actually return undefined for htat
09:19 <jle`> how about fromJustAmbVal (Just (\_ -> Just (BoolVal False))) ?
09:19 JagaJaga joined
09:19 jdt joined
09:19 Marc-Olivier joined
09:19 <sophiag> that would work, but it's not a likely input
09:19 <jle`> what is it supposed to return?
09:20 <jle`> we're trying to find the pattern
09:20 <sophiag> (_ -> False)
09:20 <mauke> sophiag: fromJustAmbVal (Just f) = \x -> case f x of Just (BoolVal b) -> b
09:20 <jle`> do you mean (\_ -> False) ?
09:20 <mauke> I think that's the complete definition you have in mind
09:20 <jle`> (_ -> False) isn't valid haskell
09:20 <jle`> sophiag: how about fromJustAmbVal (Just (\_ -> Nothing)) ?
09:21 fvgs left
09:21 coot__ joined
09:21 <sophiag> i could type a response if i could type that fast
09:21 mmhat joined
09:21 <jle`> no need to rush. any time is better than never :)
09:22 fakenerd joined
09:22 <mauke> well, I think I've solved it :-)
09:22 <Iceland_jack> Time flies like an arrow.. fruit flies like a banana
09:22 <sophiag> look at that i was about to clarify
09:22 <sophiag> mauke: i'll wait until you're done tho
09:23 <mauke> what do you mean, done?
09:23 <mauke> I am done
09:23 <sophiag> ok
09:23 <mauke> I already gave you the code I think you're looking for
09:23 <mauke> it's just a single line
09:24 <sophiag> mauke: i'm trying to respond to jle` asking me to clarify what i'm looking for here but i can't because of your badgering
09:24 <mauke> wtf
09:24 Gloomy joined
09:24 <sophiag> again, i'll wait a good long time until you're done
09:24 <mivael> tsahyt, "It does that by storing a Map of values that all have the same hash" -- I don't think so. Now I think that HashMap (the one from the hashmap package) internally maps keys not just to correspondent values but to combined values (the key itself and the correspondent value). Only to one such combined values, not to many.
09:24 <mauke> ok, good luck
09:24 <jle`> >_>
09:24 <mauke> but IRC is an asynchronous communication medium with multiple senders/receivers
09:24 <sophiag> i agree it is hard to sovle a problem when you can't get information from the person asking because you constantly interrupt them
09:25 <jle`> you aren't required to respond to every message being sent :)
09:25 juhp joined
09:25 <mauke> you'll never get anywhere if you wait for the channel to be silent for N minutes while typing your response
09:25 <sophiag> no, i just see new things directed at me from the people who already asked me to answer something
09:26 <halogenandtoast> This is heading dangerously close to help vampire territory.
09:26 <mauke> I thought you were waiting for me to stop talking?
09:26 <sophiag> i still am
09:26 <mauke> AFAICS I didn't ask you anything (apart from the initial requests for something resembling a spec)
09:27 <sophiag> btw just ignored the person who referred to me as a "vampire"
09:27 <sophiag> that was a nice touch
09:27 <mauke> not "vampire". "help vampire"
09:28 vydd joined
09:28 vydd joined
09:28 <halogenandtoast> I like the announcement though.
09:28 <sophiag> does that make the person saying it not a "jerk" but a "help jerk?"
09:28 inad922 joined
09:28 <mauke> eh?
09:28 <jle`> 'help vampire' referes to a specific term
09:28 <mauke> this one: http://www.skidmore.edu/~pdwyer/e/eoc/help_vampire.htm
09:29 <jle`> which means something altogether different than just a variation of 'vampire'
09:29 <halogenandtoast> I'm curious to find out what they think I meant?
09:30 <sophiag> i asked one question once so i don't see how i fit that definition
09:30 <sophiag> i do understand irc attracts an extremely high number of people suffering from autism tho
09:30 <sophiag> i can understand how verbal interaction would be difficult for them
09:30 <jle`> pretty sure that's uncalled for
09:31 <Iceland_jack> Doesn't sounds like you're acting in good faith now sophiag
09:31 <sophiag> um, i'm responding to being insulted for trying to ask a question
09:31 <Iceland_jack> You can do it without negatively calling people autistic
09:31 <sophiag> i literally asked one question once and then have only aswered other people since
09:31 <* Iceland_jack> shrug
09:31 <mjora7> sophiag: It's normal for IRC, just ignore the rude people.
09:32 slomo joined
09:32 <sophiag> mjora7: thank you. i suppose i should put the lot of them on ignore
09:32 <halogenandtoast> For the record, I wasn't saying he was a help vampire, just that the behavior exhibited was approaching that, but now it's too late, it is full blown help vampire territory.
09:32 <sophiag> so the two who justify insulting people as well
09:32 <sophiag> done
09:33 rockkid777 joined
09:36 takle joined
09:36 jer1 joined
09:37 <mauke> mjora7: who do you think was rude here?
09:37 abhiroop_ joined
09:37 netheranthem joined
09:38 kamyar_ joined
09:38 <mauke> for the record, I don't think sophiag's behavior fits the checklist in that article
09:38 cloudhead joined
09:39 jeltsch joined
09:39 locallycompact joined
09:39 <halogenandtoast> mauke: that's fair.
09:40 oisdk joined
09:41 <halogenandtoast> mauke: I didn't cite that checklist so I wasn't using it as my metric, but I think it's fine to let this issue drop.
09:41 matt179 joined
09:41 <mauke> yeah
09:42 <halogenandtoast> if I was the rude one then so be it. It wasn't my intent and I am unable to apologize for making someone feel attacked, so there's little to be done
09:42 <halogenandtoast> 仕方が無い
09:42 bjz joined
09:42 <Iceland_jack> ¯\_(ツ)_/¯ 仕方が無い
09:43 <halogenandtoast> Iceland_jack: exactly
09:43 <cloudhead> hey, is it possible to get some kind of stack trace out of tasty-hunit? Or some kind of indication on what line threw an exception?
09:44 <mauke> ゆっくりしていってね
09:47 <merijn> cloudhead: I believe you can get stack traces using HasCallstack nowadays, but I don't know how it works :p
09:47 <Iceland_jack> Anyone hiring in Japan? lol
09:47 <merijn> cloudhead: I'd recommend consulting the GHC manual
09:48 <cloudhead> merijn: thanks will have a look
09:49 <halogenandtoast> Iceland_jack: depends on how much you want to make
09:49 <halogenandtoast> I've been eyeballing Arrow, but I couldn't leave my current job :\
09:50 <halogenandtoast> I am however trying to force my company to do Haskell
09:50 <halogenandtoast> It's my two year plan
09:50 <merijn> cloudhead: Googling for HasCallstack will probably also turn up some useful stuff :)
09:50 TheLemonMan joined
09:50 <merijn> Iceland_jack: Closest I know is Singapore ;)
09:50 <Iceland_jack> merijn: I would melt :)
09:50 <halogenandtoast> I hear Singapore is always hiring.
09:50 xtreak joined
09:51 <Iceland_jack> I recently relocated to London so it was tongue-in-cheek
09:51 <halogenandtoast> Iceland_jack: for your reference: https://arow.info/index-en.html
09:51 <Iceland_jack> but one day
09:51 <Iceland_jack> Thank you halogenandtoast
09:51 <halogenandtoast> Iceland_jack: no problem, I love it here, we need more Haskellers.
09:51 <merijn> halogenandtoast: They are :p
09:52 <halogenandtoast> They are what?
09:52 <halogenandtoast> Oh
09:52 <merijn> halogenandtoast: Always hiring
09:52 <halogenandtoast> Singapore
09:52 <halogenandtoast> yeah
09:52 <vaibhavsagar> merijn: are you in Singapore? I just moved here
09:53 <merijn> vaibhavsagar: No, not even close :p
09:53 <halogenandtoast> I'll probably visit Singapore next year.
09:53 <vaibhavsagar> I'd heard that there were a lot of Haskellers at my company but it turns out they all left a few months ago :(
09:54 <halogenandtoast> vaibhavsagar: that sucks
09:54 <vaibhavsagar> pretty disappointed to find that out on my first day, but at least they didn't lead me on :)
09:54 <halogenandtoast> They all leave together?
09:54 <Iceland_jack> vaibhavsagar: Make new ones
09:54 <cocreature> vaibhavsagar: which company are you working at?
09:54 rockfordal joined
09:55 <merijn> vaibhavsagar: If you wanna do Haskell in Singapore, Standard Chartered is always hiring there :p
09:55 twanvl joined
09:55 <vaibhavsagar> I did apply to SC a while ago
09:56 matt179 joined
09:56 chipp joined
09:56 mekeor joined
09:56 jer1 joined
09:57 abhiroop joined
09:57 govg joined
09:58 <Iceland_jack> halogenandtoast: I don't know how competitive Japan salaries are, how are they with work visas do you know?
09:58 <halogenandtoast> Iceland_jack: are you asking about Arow or companies in general?
09:58 slomo joined
09:58 <Iceland_jack> If you know about Arrow, otherwise in general
09:58 <Iceland_jack> if companies help with relocation and such
10:00 <halogenandtoast> Iceland_jack: most companies I've talked to here (non-Haskell) have offered some amount for relocation, and have been able to provide work visas.
10:00 <halogenandtoast> The work visa situation for IT here is pretty good.
10:00 <Iceland_jack> That's good
10:00 <halogenandtoast> I don't know specifically about Arow, I moved here under very "different" circumstances
10:01 fizruk joined
10:01 <halogenandtoast> If you happen to be top notch with Ruby on Rails, I know my company would pay for relocation and would get you a visa, but it's not Haskell YET
10:01 m` joined
10:02 <Iceland_jack> What is the opposite of "top notch"? :)
10:02 oisdk joined
10:02 <Iceland_jack> that's me with RoR
10:02 jer1 joined
10:02 <halogenandtoast> Iceland_jack: happens to the best of us.
10:02 <halogenandtoast> I'm pretty bottom notch with Haskell
10:03 <Iceland_jack> I don't even know what a notch is..
10:03 <mauke> the author of minecraft
10:04 kamyar joined
10:04 <halogenandtoast> Iceland_jack: notches are indentations used sometimes for measurement, being top notch means the highest value of whatever you're measuring.
10:04 NoCreativity_ joined
10:04 <Iceland_jack> cool!
10:04 <MarcelineVQ> alternatively a notch is a setting on as machine
10:04 <MarcelineVQ> *on a
10:04 indi_ joined
10:04 <MarcelineVQ> you're top machine setting!
10:05 <Iceland_jack> :D
10:05 <Iceland_jack> joy
10:05 <halogenandtoast> Or a deep, narrow mountain pass.
10:05 <MarcelineVQ> you're top deep, narrow mount pass!
10:05 <halogenandtoast> I've been waiting for this moment.
10:05 <Iceland_jack> I've been called worse
10:05 <MarcelineVQ> belts also have notches
10:06 oisdk joined
10:06 <Iceland_jack> What a versatile word
10:06 <Iceland_jack> top notch
10:07 <halogenandtoast> Iceland_jack: I've been called worse too, pretty sure I was called autistic today :\
10:07 <halogenandtoast> as a negative.
10:07 <halogenandtoast> Being a mountain pass as a negative would be interesting.
10:08 <MarcelineVQ> I got banned once for saying autisic in a positive way, though not here
10:08 Faucelme joined
10:08 <Iceland_jack> I can't think of a single bad about mountain passes
10:08 <Iceland_jack> they help people pass
10:08 Faucelme joined
10:08 <MarcelineVQ> the two bad things are gettin stuck in one due to weather and robbers living in them
10:09 carlosda1 joined
10:10 zero_byte joined
10:10 <Iceland_jack> maintain pass robbers *shakes fist*
10:10 <halogenandtoast> Returning to my question from long ago
10:10 <halogenandtoast> Anyone know how to filter post params from Yesod logs?
10:10 <halogenandtoast> *specific* post params like "password"
10:10 ixxie joined
10:13 Wizek_ joined
10:13 balor joined
10:14 ericsagnes joined
10:16 chipp joined
10:16 v0latil3 joined
10:16 <halogenandtoast> Ok
10:16 clog joined
10:17 maaarcocr_ joined
10:17 suppi joined
10:17 <maaarcocr_> Hi! I'm trying to run in interpreted mode some haskell with runHaskell. My main problem is that it seems like it's not able to load local modules. The funny thing is that the same command works on Windows but not on Linux.
10:19 orhan89 joined
10:19 m3adi3c joined
10:20 <halogenandtoast> maaarcocr_: Did you try -i to specify an include dir?
10:20 Guest85646 joined
10:21 blender joined
10:22 MrLawrence joined
10:22 <maaarcocr_> runghc -i~/test main.hs something like this?
10:22 vaibhavsagar_ joined
10:22 <AfC> Without the ~
10:23 <AfC> ie ./
10:24 <maaarcocr_> neither of them works
10:24 <maaarcocr_> it's really weird :/
10:24 <halogenandtoast> Can you make a paste of your directory structure, the error, and the command?
10:24 <maaarcocr_> ok (i'm using stack, I hope it's not a problem)
10:24 <halogenandtoast> not for me.
10:25 osa1 joined
10:25 osa1 joined
10:26 splanch joined
10:26 mlehmk joined
10:26 <maaarcocr_> . ├── checking.hs ├── professor.hs └── student.hs
10:26 <maaarcocr_> ops sorry, anyway the directory structure is very simple, just 3 files in the same dir
10:27 splanch_ joined
10:28 <halogenandtoast> maaarcocr_: okay, can you use http://lpaste.net/new/haskell to paste the command and error.
10:28 balor joined
10:28 <halogenandtoast> or other pastebin of your choice.
10:28 dedicated joined
10:28 splanch__ joined
10:29 JackSparrow joined
10:29 <maaarcocr_> https://pastebin.com/Y8727rnk
10:30 xtreak joined
10:30 dedicated joined
10:31 <Cale> maaarcocr_: It looks for modules in files having the same name. At the very least, professor.hs should probably be Professor.hs
10:31 <maaarcocr_> Oh, I solved it! Thanks anyway for being so prompt in helping me :) (the problem was the filename)
10:31 <halogenandtoast> I don't know if this would be related, but are you on a case sensitive file system?
10:31 <halogenandtoast> Okay, glad you solved it.
10:32 [scrooge] joined
10:32 <halogenandtoast> Seems it was related.
10:32 jer1 joined
10:32 bjz_ joined
10:33 rcat joined
10:34 skeuomorf joined
10:35 danthemyth joined
10:39 Sampuka joined
10:41 jdt joined
10:42 coot__ joined
10:44 forgottenone joined
10:45 ziocroc joined
10:45 ccomb joined
10:46 blbrown_win3 joined
10:47 abhiroop joined
10:48 balor joined
10:50 latro`a joined
10:50 hazyPurple_ joined
10:51 jer1 joined
10:51 fendor joined
10:54 bhiliyam joined
10:55 slomo joined
10:55 ub joined
10:56 soniku joined
10:56 balor joined
10:56 xtreak joined
10:57 sirreal joined
10:57 edmundsecho joined
10:59 mmachenry joined
11:00 holla joined
11:00 dmiles joined
11:01 fizruk joined
11:01 fractalsea joined
11:02 dmiles joined
11:02 Snircle joined
11:03 hackebeilchen joined
11:04 balor joined
11:07 pungi-man joined
11:07 chipp joined
11:07 chipp joined
11:08 Philonous joined
11:08 jer1 joined
11:09 osa1 joined
11:09 osa1 joined
11:10 carlosda1 joined
11:11 mmn80 joined
11:13 soniku joined
11:13 fakenerd joined
11:13 uiop joined
11:14 mstruebing joined
11:14 phaji joined
11:15 MarioBranco joined
11:15 laplacian joined
11:15 mounty joined
11:16 sproingie joined
11:16 sproingie joined
11:17 KorriX joined
11:18 xall joined
11:19 augur joined
11:20 orhan89 joined
11:21 valdyn joined
11:23 mohsen_ joined
11:23 tusj joined
11:23 ExpHP joined
11:25 reynir joined
11:26 arpl joined
11:27 atk joined
11:27 oleks joined
11:29 pfoetchen joined
11:29 alios joined
11:29 madsj joined
11:30 goodboy[m] joined
11:30 hiq[m] joined
11:30 markus1199 joined
11:30 curry[m] joined
11:30 theDon joined
11:30 Geekingfrog joined
11:30 jer1 joined
11:30 aglorei joined
11:30 ProofTechnique[m joined
11:31 augur joined
11:31 abhiroop joined
11:31 edmundsecho joined
11:31 stobix joined
11:32 splanch joined
11:34 Supersonic112 joined
11:37 tusj joined
11:38 tusj joined
11:41 fakenerd joined
11:43 riman joined
11:43 Gloomy joined
11:43 mpsag joined
11:45 NeverDie_ joined
11:46 asmyers joined
11:47 asth|away joined
11:48 ogrady_ joined
11:50 jer1 joined
11:50 _sras_ joined
11:51 fendor joined
11:52 balor joined
11:52 NeverDie joined
11:52 Kreest__ joined
11:55 <abhiroop> Is there any way to interoperate between the Text in this module https://hackage.haskell.org/package/text-
11:55 <abhiroop> And the Text in Data.Text module https://hackage.haskell.org/package/text-
11:56 <abhiroop> actually I am formatting a string using text-format. I want to write that string to a file
11:56 dcoutts_ joined
11:57 <pavonia> Are you trying to use two different versions of the same package in one project?
11:57 sirreal joined
11:57 anishathalye joined
11:57 admin[m] joined
11:58 sepp2k joined
11:58 soniku joined
11:58 <pacak> abhiroop: toStrict/fromStrict
11:58 <Cale> If not, then the answer is Data.Text.Lazy.fromChunks
11:59 <pacak> and toChunks/fromChunks
11:59 NyanPasu joined
11:59 <pacak> pavonia: Sounds like bad idea.
11:59 <Cale> Or yeah, indeed, toStrict/fromStrict
12:00 watersoul joined
12:00 MarioBranco joined
12:03 forgottenone joined
12:03 MarioBranco joined
12:03 paolino joined
12:04 eklavya joined
12:05 watersoul joined
12:05 vaibhavsagar_ joined
12:06 bhiliyam joined
12:07 fakenerd joined
12:07 fractalsea joined
12:08 m3adi3c joined
12:08 sirreal joined
12:08 __Myst__ joined
12:09 <__Myst__> Hi, can I ask for a code review?
12:09 xtreak joined
12:09 <__Myst__> If so, I was wondering if there was anything non-idiomatic or generally wrong/bad witih this code http://termbin.com/0wws
12:09 mthek joined
12:10 balor joined
12:10 watersoul joined
12:11 jer1 joined
12:11 carlosda1 joined
12:11 <ggVGc> I want to consume a few endpoints of a rest api that returns JSON blobs. What's my best/quickest bet_
12:11 <ggVGc> ?
12:11 <ggVGc> I don't need to do any posts or puts atm
12:11 <ggVGc> just retrieving data
12:11 splanch joined
12:13 <kuribas> __Myst__: my preference is to avoid long lines.
12:13 ixxie joined
12:13 danthemyth joined
12:13 <abhiroop> Cale: I am dealing with Data.Text.Internal.Lazy not Data.Text.Lazy
12:13 <__Myst__> kuribas: L27?
12:13 <liste> ggVGc: wreq
12:13 <abhiroop> Have a look at the format function here: https://hackage.haskell.org/package/text-format-
12:14 <abhiroop> The Text that it returns
12:14 <liste> @hackage wreq -- ggVGc
12:14 <lambdabot> http://hackage.haskell.org/package/wreq -- ggVGc
12:14 <kuribas> __Myst__: "let [nick, cs'] = splitOn ..."
12:14 <Cale> abhiroop: The type which is defined there is re-exported by Data.Text.Lazy
12:15 danthemyth joined
12:15 <ggVGc> liste: yeah, I was looking at that. But I also think Servant might be interesting? https://haskell-servant.github.io/client-in-5-minutes.html
12:15 watersoul joined
12:15 <liste> ggVGc: servant's mostly for serving, not consuming
12:15 fizruk joined
12:15 <liste> ggVGc: the client library is best when coupled with a servant server
12:16 NyanPasu joined
12:16 soniku joined
12:16 vektorweg1 joined
12:17 magneticduck joined
12:17 zcourts_ joined
12:17 <liste> ggVGc: wreq's tuned for consuming json blobs in an ad-hoc manner
12:20 balor joined
12:20 watersoul joined
12:20 <ggVGc> alright
12:20 <ggVGc> have you used wreq?
12:20 <liste> ggVGc: yes, a bit
12:21 <liste> see the tutorial: http://www.serpentine.com/wreq/
12:21 orhan89 joined
12:23 <Axman6> ggVGc: servant-client is quite a nice way to get the client functions 'for free', you just model the API of the service and it takes care of much of the rest of it
12:25 watersoul joined
12:26 <__Myst__> kuribas: how could i split that up?
12:26 <kuribas> __Myst__: with layout
12:26 <__Myst__> layout?
12:26 <__Myst__> maybe like this? http://termbin.com/ea3e
12:27 <kuribas> __Myst__: that looks better
12:29 ogrady joined
12:29 ziyourenxiang joined
12:30 leptonyu joined
12:31 zeroed joined
12:31 zeroed joined
12:33 kagcc joined
12:33 <__Myst__> kuribas: anything else?
12:34 <kuribas> __Myst__: undefined means not yet implemented?
12:35 jer1 joined
12:35 dsh joined
12:36 orhan89 joined
12:37 fendor joined
12:38 locallycompact joined
12:40 ccomb joined
12:41 Gloomy joined
12:41 dennisvennink joined
12:45 stevenxl joined
12:45 muff1nman joined
12:46 balor joined
12:48 <__Myst__> kuribas: means that it's wrong input
12:49 <kuribas> __Myst__: better use error then
12:49 orhan89 joined
12:49 stevenxl joined
12:49 <__Myst__> why?
12:49 <kuribas> __Myst__: better error messages
12:50 <__Myst__> error "{functionName}: {reasonForInvalidInput}!"?
12:51 <kuribas> yes
12:51 abhiroop joined
12:51 alios joined
12:51 <abhiroop> Thanks Cale
12:51 <kuribas> __Myst__: if that is reachable, you'ld probably need something better.
12:52 <kuribas> __Myst__: Using an exception, or returning Either.
12:54 jer1 joined
12:57 forgottenone joined
12:58 <c_wraith> in general, the rule of thumb between the cases is to use error if some invalid input represents programmer error, and something like Maybe/Either if it's bad input the programmer can't reasonably prevent
12:59 Kototama joined
13:00 <Kototama> does it make sense to use free monads to operate on an ADT, even if the ADT does not represent operations but data? to gain the flexibility of interpreting the data in different way?
13:00 <merijn> Kototama: "Yes, No, Maybe, It Depends" ;)
13:00 rockkid777 joined
13:00 <merijn> Kototama: You'll get better answers if you can give some more detailed examples of what you're doing
13:01 laplacian joined
13:01 fakenerd joined
13:02 <Kototama> i need to transform a tree-like ADT into another datastructure
13:02 <Kototama> and i need to map values from an external service back to this tree-like ADT
13:03 <c_wraith> What the free monad does is very constrained. If it works, it makes sense. :)
13:03 <Kototama> :)
13:03 cpennington joined
13:03 anishathalye joined
13:04 <Kototama> just all example online are for encoding a DSL
13:04 nighty-- joined
13:04 <nshepperd> sounds like maybe recursion-schemes would be of interest
13:04 <Kototama> whereas my ADT is just data
13:05 <nshepperd> if you define a treelike data type as a fixpoint of a functor, you get various foomorphisms for free
13:05 blender joined
13:06 abhiroop joined
13:06 admin[m] left
13:06 <* pacak> loves the smell of foomorfisms in the morning
13:06 <Kototama> i don't know how to do that, do you have articles / blogs?
13:06 <merijn> nshepperd: Honestly, every time I look at recursion-schemes I mostly just get confused and decide to write the "foomorphisms" myself by hand :p
13:07 <Kototama> pacak foodmorphism?
13:07 splanch joined
13:08 <pacak> merijn: recursion-schemes is not that bad and it helps if you have a tree-like structure and still want to use foomorfisms.
13:08 BlueRavenGT joined
13:08 splanch_ joined
13:08 <fendor> is there an irc channel for stack?
13:09 <pacak> merijn: https://medium.com/@jaredtobin/practical-recursion-schemes-c10648ec1c29
13:09 <pacak> have you seen this?
13:10 <nshepperd> Kototama: I'm not sure what is the best introduction
13:10 <nshepperd> maybe the one pacak linked
13:10 <kuribas> __Myst__: I use undefined only for "I'll fill this expression in later", even then some people prefer error.
13:11 <nshepperd> the short version is, instead of 'data Tree a = Leaf a | Node (Tree a) (Tree a)' and manual recursion, you write 'data TreeF a r = Leaf a | Node r r; type Tree a = Fix (TreeF a)'
13:11 <pacak> Kototama: http://eprints.eemcs.utwente.nl/7281/01/db-utwente-40501F46.pdf - or this
13:11 <pacak> Kototama: Your brain will hurt at the beginning, but you'll get used to it.
13:11 <Kototama> my tree is not recursive like that, each layer has different type
13:12 <nshepperd> and the you get the function 'cata :: (TreeF a b -> b) -> Tree a -> b' for free
13:12 <nshepperd> which is like foldr for trees
13:12 carlosda1 joined
13:12 coot__ joined
13:13 fendor left
13:13 fendor joined
13:13 <nshepperd> well, this can work for any recursive ADT
13:13 <nshepperd> unless it's irregular recursion. then, uh
13:14 <merijn> pacak: Yeah, I *understand* them, I just don't find them easy to use :)
13:14 <Kototama> i don't have the same ADT at the first and at the second level
13:14 <merijn> kuribas: Don't use undefined for "I'll fill this in later", use typed holes!
13:14 <merijn> kuribas: Much more robust/less likely to escape unnoticed
13:16 <pacak> merijn: They are nice if you want to transform AST - normalize expression, partially evaluate, simplify and so on.
13:16 sproingie joined
13:17 <kuribas> merijn: then you cannot run the rest of the program?
13:18 <merijn> kuribas: You can, I fixed that several versions of GHC ago :)
13:18 <kuribas> merijn: oh great :)
13:18 <merijn> kuribas: -fdefer-typed-holes turns typed holes into runtime errors
13:18 <kuribas> right
13:18 <merijn> Similar to -fdefer-type-errors, but working on holes only :)
13:18 <kuribas> __Myst__: so what merijn and c_wraith said...
13:19 <merijn> In which case they're identical to undefined, except with neat compiler warnings about their presence ;)
13:19 <ph88_> i have a math formula with small n and big N is there a convention for naming haskell variables of things which are usually put as capital ?
13:19 jer1 joined
13:20 Gloomy joined
13:21 <nshepperd> Kototama: I guess the answer to that depends on your exact situation
13:21 <merijn> ph88_: Not really, tbh
13:21 <ph88_> oki
13:21 bhiliyam joined
13:22 <pacak> > let ɴ = 3 ; n = 4 in ɴ * n
13:23 <nshepperd> Kototama: for me it feels like recursion-schemes is sort of the equivalent of free monads for data, though, which is why i bring it up. I think it's useful to know about anyway :)
13:23 <lambdabot> 12
13:23 cdg joined
13:23 <pacak> ph88_: You can use small n and big N as variables as long as they both are small.
13:23 <Kototama> nshepperd: thank you :) it may be a bit too complex for me now
13:23 <__Myst__> Why would I use Fix over regular recursion?
13:23 oisdk joined
13:24 Swizec joined
13:24 <Kototama> i have somecode here http://paste2.org/U2pLwYBN (in PureScript)
13:24 <ph88_> pacak, haha that first n looks big, but is still small :P
13:24 mmachenry joined
13:24 jimmyrcom joined
13:24 sepp2k joined
13:24 <ph88_> i'll take it
13:25 fakenerd joined
13:26 al-damiri joined
13:28 cyborg-one joined
13:29 rockkid777 joined
13:29 salva joined
13:29 mizu_no_oto_work joined
13:30 <ph88_> since both indexing and safe-indexing are O(1) why would you wanna use (unsafe?) indexing ? https://hackage.haskell.org/package/vector-
13:30 eschnett joined
13:30 <nshepperd> Kototama: oh, I see, it's not recursive at all. I suppose recursion-schemes won't really help here then
13:30 acarrico joined
13:30 <pacak> ph88_: range checking
13:30 <ph88_> you wanna use unsafe indexing for range checking ?
13:31 <nshepperd> avoiding range checking gets the maximum performance, I assume
13:31 <pacak> save indexing will give friendly error message when index is out of bounds. unsafe will explode, burn your house and eat your cat.
13:31 <pacak> But unsafe is faster.
13:31 <merijn> ph88_: O(1) says the operation is constant time, it doesn't say anything about the size of the constant
13:31 <ph88_> ah ok
13:32 <merijn> ph88_: So safe-indexing could be a million times slower than indexing, but still be constant time
13:32 soniku joined
13:33 meba joined
13:33 <ph88_> foldl' was the fastest fold right ?
13:33 <pacak> Depends
13:33 <merijn> It Depends (TM)
13:35 <nshepperd> for an operation on small data that is strict in both arguments, it's a safe bet
13:37 <pacak> nshepperd: Not if operation is expensive and you can get away with folding only part of the list.
13:38 jer1 joined
13:38 <ph88_> merijn, which fold could i best use here ? https://bpaste.net/show/54a30c73f361
13:38 plutoniix joined
13:38 <ph88_> for speeeeeeed
13:39 plutoniix joined
13:40 abhiroop joined
13:41 <ph88_> does it even matter if i do foldr or foldl for + ?
13:41 Uakh joined
13:41 jathan joined
13:41 <merijn> for + you want foldl'
13:41 <ph88_> maybe i should use sum ?
13:41 <pacak> map and sum
13:41 <pacak> those are more readable
13:42 <mniip> @src sum
13:42 <lambdabot> sum = foldl (+) 0
13:42 <mniip> you want foldl'
13:42 <ph88_> so not use sum ?
13:42 <mniip> well, depends on how smart ghc is
13:42 <ph88_> sum' = foldl' (+) 0
13:42 <nshepperd> pacak: then you want foldl' with some sort of early stopping condition attached, I guess. which amounts to foldr with some continuation stuff
13:43 <mniip> nshepperd, but what about strictness
13:45 stef204 joined
13:46 kagcc joined
13:46 <nshepperd> what about it
13:47 <nshepperd> @let sum100 xs = foldr (\x k acc -> if acc >= 100 then min 100 acc else k $! (acc + x)) id xs 0
13:47 <lambdabot> Defined.
13:47 <nshepperd> > sum100 [1..]
13:47 <lambdabot> 100
13:48 <nshepperd> > sum100 [1..10]
13:48 <lambdabot> 55
13:48 <ph88_> i'm getting confused now, what should i put for sum_1 ? https://bpaste.net/show/c695241f3974
13:49 doomlord joined
13:49 `^_^v joined
13:50 <ph88_> is this right? sum_1 = sum' $ map (\x -> sum_2 ** 2) list_j
13:51 ChristopherBurg joined
13:51 chlong joined
13:52 kmels joined
13:53 <jchia_1> I have newtype Foo a = Foo (a, a). Can I make a Bifunctor instance for it? I'm having trouble because there's only one type param.
13:53 <Cale> No.
13:53 <Cale> You could make a Functor instance for it.
13:53 justin3 joined
13:53 <jchia_1> Cale: What's the closest I can get? I want to be able to use the Bifunctor functions on it.
13:53 <Cale> Then you should newtype it differently
13:54 <jchia_1> Cale: Sometimes I want to fmap the left side, sometimes the right side.
13:54 <jchia_1> Cale: How?
13:54 <Taneb> jchia_1, why aren't you just using (,)
13:54 <nshepperd> ph88_: maybe it would help to write down some types for these things
13:54 <ph88_> ok
13:54 <Cale> newtype Foo a b = Foo (a,b)
13:54 <jchia_1> Taneb: Readability and type safety. I want to have function names be meaningful that work for it.
13:54 <Taneb> jchia_1, then do something like data Foo a b = Foo a b
13:55 <jchia_1> Taneb: The left and right side have to be the same type.
13:55 edmundsecho joined
13:55 <Cale> jchia: Think about, e.g. what happens when you apply first show to something of type Foo Integer
13:55 <nshepperd> ph88_: there's a sum_2 for each j, right? so that should be a list of Doubles or something
13:55 <Cale> Supposing that there were some sort of Bifunctor instance available
13:55 <c_wraith> jchia_1: Bifunctor and Functor are type-based. If you want to treat the two components differently, you need something other than the type to dispatch on.
13:55 <c_wraith> jchia_1: lenses are the usual answer
13:55 locallycompact joined
13:55 <nshepperd> ph88_: then sum_1 is the sum of squares of sum_2
13:55 <jchia_1> Cale: You get (String, Integer)
13:55 <ph88_> nshepperd, yes .. i want to sum the [Double]
13:56 <Cale> jchia_1: Yeah, which obviously doesn't work if you only have one type parameter
13:56 <jchia_1> Cale: I mean I want it to give me (String, Integer), but I see the problem.
13:56 locallycompact joined
13:56 <Cale> wait, what?
13:56 <Cale> It would have to give you Foo something, for sure
13:57 oaaao joined
13:57 <Cale> (but really, it makes no sense at all, because it would be a kind error)
13:57 <jchia_1> I mean I want first show (Foo 1 2) to give me back a type Foo "1" 2, but I see the probem when there's only one type param.
13:57 <Cale> yeah
13:58 <Cale> also, that would be using data rather than newtype then
13:58 <jchia_1> OK, at least I can make a Functor instance
13:58 asthasr joined
13:59 <jchia_1> Cale: OK, just to illustrate the idea
13:59 descender joined
13:59 jer1 joined
14:00 glamas joined
14:00 takle joined
14:00 shyn joined
14:01 ystael joined
14:01 <merijn> Any linux users willing to quickly test something for me?
14:02 mohsen_ joined
14:02 fragamus joined
14:03 xall joined
14:04 abhiroop joined
14:04 mkoenig joined
14:06 leobloom joined
14:06 <jchia_1> merijn: What do you need to test?
14:06 anishathalye joined
14:08 simukis__ joined
14:08 <merijn> jchia_1: I have a small library dealing with pty's which works fine for me on OSX, but someone reported it wasn't working on linux, so I need someone to check if the terminal config is getting messed with
14:09 <jchia_1> OK, specifically, what needs to be done on Linux for the test?
14:09 <jchia_1> I'm not familiar with pty.
14:09 rockkid777 joined
14:09 <merijn> jchia_1: Basically, it's a matter of 1) cloning https://github.com/merijn/posix-pty 2) building with tests 3) running the "dist/build/stty/stty" executable cabal builds and then running "stty -a" and dumping the output of both on lpaste
14:10 pera joined
14:11 <jchia_1> OK, let me try.
14:11 uuplusu_ joined
14:11 hsk3 joined
14:12 <jchia_1> merijn: How do I build it? I'm not familiar with how to do cabal non-stack builds.
14:13 carlosda1 joined
14:13 freusque joined
14:13 <hsk3> When I run my app like this:
14:13 <hsk3> stack --docker-run-args='-p 4567:4567' exec my_web_app -- -p 4567
14:13 <hsk3> I cannot connect to that app on my local computer's localhost:4567
14:13 <hsk3> Why not?
14:13 <merijn> jchia_1: "cabal configure --enable-tests && cabal build" should probably work (since afaik all the dependencies ship with GHC)
14:13 <glguy> jchia_1: if you only know how to build with stack, use stack
14:14 <merijn> glguy: He can't, because I didn't write a stack.whatever :p
14:14 <glguy> that's not important
14:14 <glguy> stack.yaml shouldn't be in the repo anyway
14:14 thimoteus joined
14:14 <glguy> that's what stack init is for
14:15 <ph88_> why does my vector go out of bounds ? https://bpaste.net/show/7287aaff59ac
14:16 <glguy> libraries can't depend on a custom stack.yaml since they're destined to be built as dependencies in another project
14:16 nicknovitski joined
14:16 <ph88_> nshepperd, ^
14:18 CurryWurst joined
14:19 gawen joined
14:19 theelous3 joined
14:19 chrisdotcode joined
14:19 <ph88_> oh i think i know why .. but i thought lazy solved it
14:19 <jchia_1> merijn: Still working on it
14:19 jer1 joined
14:20 yellowj joined
14:21 meba joined
14:23 <merijn> jchia_1: no worries :)
14:25 <glguy> ph88_: takeWhile (<= n) [m..]. is. [m..n]
14:26 <jchia_1> merijn: I ran "stack test" and got some output. I'll chat the output to you directly.
14:27 jchia_ joined
14:28 orhan89 joined
14:28 <merijn> jchia_: You can also simply lpaste it if that's easier :)
14:28 <jchia_> merijn: Never mind, here's the lpaste: http://lpaste.net/354759
14:29 <merijn> jchia_: Could you also paste the output of "stty -a" if you run it in the same terminal?
14:30 xall joined
14:30 <jchia_> merijn: That was just stty. Here's "stty -a": http://lpaste.net/354761
14:30 thvu joined
14:30 robkennedy joined
14:32 <merijn> jchia: I think the second one is the same as the output of the test? ;)
14:32 jchia_ joined
14:33 mmachenry joined
14:34 <quchen> glguy: Careful,
14:34 <quchen> > takeWhile (<= 3) [0.1 ..]
14:34 <lambdabot> [0.1,1.1,2.1]
14:35 <quchen> > [0.1 .. 3]
14:35 <lambdabot> [0.1,1.1,2.1,3.1]
14:35 <glguy> quchen: check the paste
14:35 <merijn> A pox upon the insanity that is Enum for Double
14:35 <glguy> we're talking about vector indexes?
14:35 ubsan_ joined
14:35 <quchen> glguy: Oh, it was about a paste. Nevermind then
14:36 <quchen> Anyway: enumerating the reals is hard :-)
14:36 spear2 joined
14:37 butterthebuddha joined
14:37 <spear2> hi all, does anyone know about xmobar "avoidStruts" layout breaking with newer versions of xmonad + xmobar ?
14:37 hive-mind joined
14:37 tomphp joined
14:38 <spear2> i just upgraded to xmonad 0.13 + xmobar 0.24.3 and now xmobar is hiding behind xmonad windows
14:39 <jchia_> merijn: Yes, they look the same except for blank lines, but that's what I got. Do you want me to try something else?
14:39 stphrolland joined
14:40 sid_fules joined
14:40 jer1 joined
14:40 <Taneb> spear2, might be worth asking in #xmonad ?
14:40 <merijn> jchia_: I find it odd that "stty -a" would include both a Haskell error and a size of 10x10, because I wouldn't expect you to use a 10 by 10 terminal :)
14:41 <spear2> Taneb: thx
14:41 m3adi3c joined
14:42 a3Dman joined
14:43 <jchia_> merijn: Yeah, that looks odd.
14:45 harfangk joined
14:46 jchia_ joined
14:47 Gurkenglas_ joined
14:47 <lpaste> hexagoxel pasted “merijn” at http://lpaste.net/354763
14:47 burtons joined
14:48 <merijn> hexagoxel: Ok, that looks mostly sane
14:48 orhan89 joined
14:48 <merijn> hexagoxel: Which distro?
14:48 <hexagoxel> arch
14:48 HarveyPwca joined
14:48 augur joined
14:49 conal joined
14:49 <merijn> hexagoxel: Which glibc version?
14:50 sid_fules joined
14:51 <ph88_> which i could quickly plot graphs form ghci
14:51 <merijn> Unrelatedly: Apparently my Hackage password got wiped from my password store and while Chrome remembers it, I can't actually get the plaintext to use "cabal upload" >.<
14:51 <stphrolland> Hi everyone. I'm getting compilation errors when I try to pass a lens getter as a parameter of a polymorphic function. Code is here: http://lpaste.net/354766. I don't grasp the error I am doing. Could you give me any insight on the problem ?
14:51 <hexagoxel> merijn: 2.25
14:52 <merijn> hexagoxel: hmmm, error is happening on Debian with 2.24, so maybe that combo is just broken
14:53 FjordPrefect joined
14:53 gcross_ joined
14:59 ubsan_ joined
14:59 abhiroop joined
15:00 oaaao joined
15:00 oaaao joined
15:01 jer1 joined
15:02 selthas joined
15:03 uglyfigurine joined
15:05 mohsen_ joined
15:05 crobbins joined
15:06 splanch joined
15:06 abhiroop joined
15:08 <Kototama> Is it possible to transform that http://paste2.org/Whe1waGp into a F-algebra?
15:10 flatmap13 joined
15:10 splanch joined
15:11 steeze joined
15:11 raichoo joined
15:13 carlosda1 joined
15:14 azahi joined
15:14 <ph88_> seems that pandoc is not perfect :( http://pandoc.org/try/?text=TDEV(n+*+%5Ctau)+%3D++%5Csqrt%7B+%5Cfrac%7B1%7D%7B6n%5E2(N-3n%2B1))%7D+%5Csum_%7Bj%3D1%7D%5E%7BN-3n%2B1%7D+%5Cleft(+%5Csum_%7Bi%3Dj%7D%5E%7Bn%2Bj-1%7D+(x_%7Bi%2B2n%7D-2x_%7Bi%2Bn%7D%2Bx_i)%5Cright)%5E2+%7D&from=latex&to=asciidoc
15:15 mikecaruso joined
15:16 eazar001 joined
15:16 abhiroop joined
15:17 sproingie joined
15:17 <shapr> ph88_: put up a PR?
15:18 <ph88_> that's quite complex .. i found a website that does it
15:18 <ph88_> http://www.sciweavers.org/free-online-latex-equation-editor
15:20 bhiliyam joined
15:21 Sentry812 joined
15:21 pbogdan joined
15:21 jer1 joined
15:21 splanch joined
15:21 <Sentry812> What's haskell?
15:22 <Iceland_jack> A programming language
15:22 <ph88_> true story
15:22 Aune joined
15:22 <Sentry812> Oh.
15:22 bodisiw joined
15:23 <ph88_> it even has two websites ! https://haskell-lang.org/ https://www.haskell.org/
15:23 <Sentry812> Hm.
15:24 <rom1504> Sentry812: it starts with h, continues with a, then it progresses to s, to get to k, eventually it gets to e, and it finishes by 2 l
15:24 <quchen> ph88_: Looks like something more serious, since http://pandoc.org/try/?text=%5Cfrac%7B1%7D%7B1%7D&from=latex&to=html5
15:24 <rom1504> you can use something called google to know about it
15:24 <ph88_> rom1504, you could have lambdabot write that
15:24 <Iceland_jack> > map toUpper "Haskell!"
15:24 <lambdabot> "HASKELL!"
15:25 dedicated joined
15:25 Sentry812 left
15:25 S1 joined
15:26 S1 left
15:26 Achylles joined
15:29 cloudhead joined
15:29 coot__ joined
15:29 Yuras joined
15:30 mthek joined
15:30 coot__ joined
15:31 ragepandemic joined
15:31 des_ joined
15:32 loorke joined
15:32 Wuzzy joined
15:36 aarvar joined
15:36 <ph88_> how can i parse everything until "\r\n" with attoparsec ?
15:38 a3Dman joined
15:39 hurkan joined
15:39 fotonzade joined
15:40 t7 joined
15:40 ilyaigpetrov joined
15:40 afarmer joined
15:40 <ski> > [c | c <- ['\0' ..],isUpper c,isLower c]
15:40 <lambdabot> ""
15:40 urodna joined
15:40 <ski> > zipWith toCase (map charCase "Haskell!") "PASCAL ?"
15:40 <lambdabot> "Pascal ?"
15:41 xall_ joined
15:41 eklavya joined
15:41 r1m4n joined
15:41 <ph88_> cute
15:42 jer1 joined
15:42 Itkovian joined
15:43 azahi joined
15:44 yogsototh joined
15:45 blocky_ joined
15:45 meoblast001 joined
15:45 osa1 joined
15:46 yogsototh joined
15:46 azahi left
15:46 suppi joined
15:48 loorke joined
15:48 _sras_ joined
15:48 kadoban joined
15:48 jao joined
15:49 <ph88_> i try to parse everything up to "\r\n" , this is what i have so far https://bpaste.net/show/fcd09185ec91 don't understand what's wrong with the bytestring types
15:50 des_ joined
15:51 <mauke> apparently you're mixing strict and lazy bytestrings
15:51 refold joined
15:52 Ferdirand joined
15:54 pbogdan_ joined
15:56 <ph88_> which one is lazy ?
15:57 <ph88_> i use string from here https://hackage.haskell.org/package/attoparsec-
15:57 <ph88_> it's strict i think
15:57 hazyPurple_ joined
15:57 <ph88_> singleton from here https://hackage.haskell.org/package/bytestring- .. also strict
15:58 laplacian joined
15:58 <codedmart> How does `Double` work with Aeson? I am testing some decoding in the console. The output is not what I would expect.
15:58 <codedmart> https://gist.github.com/codedmart/f4ebb71728742a6643c403392437cb59
15:59 conal joined
15:59 <codedmart> I would expect this to fail parsing and return `Nothing`?
15:59 <ph88_> ooh i see it i think import qualified Data.ByteString.Lazy as B
15:59 <ph88_> using the wrong package :/
16:00 <ph88_> how can i convert Char to Word8 ? https://bpaste.net/show/7dab35c01f48
16:01 mmhat joined
16:01 <ph88_> codedmart, you mean because of _length ?
16:02 <lyxia> codedmart: https://github.com/bos/aeson/blob/1cf3edc3fab98a530042891b63bd363c94cf15de/Data/Aeson/Types/FromJSON.hs#L181-L185 NaN <-> null
16:02 butterthebuddha joined
16:02 <codedmart> ph88_: Yeah
16:02 <codedmart> lyxia: That seems odd to me.
16:02 <codedmart> So I need to account for this myself then
16:03 jer1 joined
16:03 <lyxia> ph88_: toEnum . fromEnum
16:03 <ph88_> codedmart, this seems wrong to me as well .. line 183
16:05 <codedmart> @phadej you around? It looks like you added that?
16:05 <lambdabot> Unknown command, try @list
16:06 <ph88_> lyxia, uf that's a bit ugly i think .. but ok .. i try to implement it https://bpaste.net/show/80852fd0b2ea
16:07 <ph88_> codedmart, i think null is another type .. maybe he intended to parse NaN into NaN there ? i think JS has also NaN so it's good to account for that case
16:07 Sonolin joined
16:07 athan joined
16:07 <lyxia> If you're using the Char8 module you don't need to convert Char explictily
16:08 meba joined
16:08 <ph88_> how do i use the Char8 module ? just import ?
16:08 <lyxia> yeah
16:09 <lyxia> ph88_: the last <*> should be <$>, or more simply, import Data.ByteString.Char8 as BSC ... BSC.singleton <$> anyChar
16:11 <ph88_> lyxia, i try it https://bpaste.net/show/793141aad59b
16:11 <ph88_> oh shit
16:11 <ph88_> <*>
16:11 <ph88_> nvm
16:12 eklavya joined
16:12 <ph88_> ok this is not easy with so many modules
16:12 <ph88_> i use no 5 !!! modules about bytestring !
16:12 <phadej> codedmart: ?
16:13 <ph88_> phadej, about this https://github.com/bos/aeson/blob/1cf3edc3fab98a530042891b63bd363c94cf15de/Data/Aeson/Types/FromJSON.hs#L181-L185
16:13 <codedmart> phadej The NaN in FromJSON
16:13 <codedmart> I guess what ph88_ said makes sense though.
16:13 mmachenry joined
16:13 <phadej> it makes `Double` and `Float` preserve NaN's
16:14 <codedmart> I would expect Null to not parse though.
16:14 <phadej> because `toJSON NaN = Null`
16:14 <codedmart> Because Null is not the same as NaN in js.
16:14 carlosda1 joined
16:14 <ph88_> ups .. forgot i have a rust workshop this evening
16:14 le_frogballs joined
16:14 zeroed joined
16:14 zeroed joined
16:15 <phadej> codedmart: if you thing it's wrong, open an issue
16:15 <ph88_> phadej, maybe toJSON and fromJSON don't have to be the reverse of each other
16:15 splanch joined
16:15 HoierM joined
16:16 Itkovian joined
16:16 <codedmart> I didn't know NaN existed in Haskell. Is that in Base?
16:16 <phadej> ph88_: there indeed aren't such requirement; but in 99.9999% you do want that
16:16 <pikajude> it's a Double
16:16 mgaare joined
16:16 <pikajude> NaN is part of the ieee-whatever standard
16:16 <Sornaensis> > NaN
16:16 <pikajude> oh i guess it's also a float
16:16 <lambdabot> error: Data constructor not in scope: NaN
16:16 <pikajude> > 0 / 0
16:16 <lambdabot> NaN
16:16 <pikajude> there you go
16:16 <Sornaensis> > isNaN (0/0)
16:16 <lambdabot> True
16:16 <pikajude> there's no NaN literal
16:16 <pikajude> nor should there be really
16:17 <Sornaensis> > (0/0) == (0/0)
16:17 descender joined
16:17 <lambdabot> False
16:17 <Sornaensis> cool
16:17 fizruk joined
16:17 <pikajude> that's also part of the ieee754 standard
16:17 <codedmart> Yeah I guess that makes sense. Just didn't realize it.
16:17 <ph88_> yes the fpu in the cpu will give the result if a number is a NaN .. it's not on the software level ..
16:17 <pikajude> i hope I put enough e's in that
16:17 <pikajude> ieeeee754
16:17 <Sornaensis> eye triple ee
16:17 sleffy joined
16:17 splanch_ joined
16:18 tomphp joined
16:18 <ph88_> anyway that doesn't explain why null should be converted to NaN :P
16:19 <ph88_> remove this line https://github.com/bos/aeson/blob/1cf3edc3fab98a530042891b63bd363c94cf15de/Data/Aeson/Types/FromJSON.hs#L183 and null will be a type error i think
16:20 insitu joined
16:20 <lyxia> but why would you want to encode *less* of a type
16:20 <pikajude> well
16:20 <pikajude> if it's wrong
16:20 splanch joined
16:20 <phadej> it's not
16:21 <phadej> NaN is correct Double value
16:21 <pikajude> i know, but i'm providing an example
16:21 <phadej> if you want non-NaN Double, use newtype
16:21 <pikajude> for example, you wouldn't really want parseRealFloat to accept string inputs
16:21 <pikajude> and convert them to doubles
16:21 <lyxia> good thing it doesn't
16:21 <Sornaensis> why not
16:21 <pikajude> it's a recipe for disaster Sornaensis
16:22 <pikajude> for example, strings have more precision than doubles
16:22 <Sornaensis> Sure but any specific reason?
16:22 <Sornaensis> ah
16:22 <phadej> and aeson tries to preserve the whole type domain (and precision), because otherwise generic deriving would do wrong thing
16:22 <pikajude> node.js will sometimes return the same inode for separate files
16:22 <phadej> when you don't care about actual wire format
16:22 <pikajude> because they're downcasted from a 64-bit int to a 53-bit double
16:22 <Sornaensis> I mean I know for instance using Integer is bad because arbitrary memory usage
16:22 <pikajude> or a 52-bit double
16:22 <phadej> only that parseJSON . toJSON = id
16:22 <pikajude> well, haskell's Integer type converts between int and bignum iirc
16:22 cpennington joined
16:22 <pikajude> so you don't have to worry about that too much
16:23 <phadej> pikajude: in aeson you have
16:23 <phadej> because 1e1000000
16:23 <Sornaensis> if you are deserializing a heug number
16:23 <phadej> would blow you memory
16:23 <pikajude> well that's what Scientific is for, right
16:23 jer1 joined
16:23 <phadej> pikajude: yes, but you shouldn't use Integer instance when parsing untrusted JSON
16:24 <pikajude> anyway, my point being that it wouldn't make any sense for aeson to decode strings as doubles even though it is technically encoding "less" of a type
16:24 <phadej> pikajude: and it doesn't, however it makes sense to decode null into NaN
16:24 <pikajude> because the string to double conversion is fraught with peril
16:24 <pikajude> i know
16:24 <pikajude> but the question was "why would you want to encode less of a type"
16:24 <pikajude> and my answer is "if encoding more of the type is incorrect behavior"
16:24 <pikajude> i'm not saying null -> NaN is
16:25 <pikajude> just giving an example
16:25 <phadej> and infact htere is a bug in aeson
16:25 <phadej> encode (1/0 :: Double)
16:25 <phadej> "null"
16:25 <phadej> but I don't know elegant way to solve that (except encoding infinities as strings)
16:25 Sampuka joined
16:27 tomphp joined
16:27 <phadej> > 1/0 :: Double
16:27 <lambdabot> Infinity
16:27 <Sornaensis> > (1/0) > (0/0)
16:27 <lambdabot> False
16:28 <Sornaensis> > compare (1/0) (0/0)
16:28 <lambdabot> GT
16:33 __main__ joined
16:36 tomphp joined
16:36 dennisvennink joined
16:37 ragepandemic joined
16:37 fizruk joined
16:38 <orion> Let's say I wanted to start a service like Amazon Lambda, but instead of running nodejs or python code, I ran Haskell code. What packages/modules should I look in to for compiling/running the code?
16:38 <orion> Is the `plugins` package any good, or is it an unmaintained mess?
16:38 tomphp joined
16:39 eklavya_ joined
16:39 _sg joined
16:40 Xanather joined
16:41 vtomole joined
16:41 <geekosaur> plugins is a wrapper around hint these days, you might go direct to the source. (plugins originated before hint)
16:42 blender joined
16:42 <geekosaur> but it depends on exactly what you want to do, there are multiple approaches available (hint/plugins, cloud haskell, etc.)
16:43 <orion> I don't think Cloud Haskell is what I am looking for.
16:43 cables joined
16:43 <burtons> but...cloud
16:44 zaquest joined
16:44 <geekosaur> just mentioning as another possibility. there's more than that but I'm still working on my first coffee...
16:44 <orion> I want something simple like, "When a FOO happens, execute this piece of Haskell code, which will return a code that will cause me to BAR."
16:45 <orion> s/code/Haskell value
16:45 <cocreature> geekosaur: I’m pretty sure plugins is not a wrapper around hint. plugins can do things like compile to object code and then load that while hint does runtime interpretation
16:46 <orion> And a major working assumption I have: I possess a magical way of weeding out "bad" code that would, say, execute forever.
16:46 <cocreature> orion: that’s easy. just kill it after a fixed time frame
16:46 <orion> cocreature: Right.
16:47 <orion> So what I'm wondering is what options besides `plugins` is available.
16:47 jer1 joined
16:49 <geekosaur> cocreature, pretty sure it is, to the extent that it uses hint instead of ghc-api directly for most (possibly not all) things
16:49 <cocreature> geekosaur: it doesn’t even depend on hint
16:49 cpennington joined
16:50 splanch joined
16:55 Swizec joined
16:56 uglyfigurine joined
16:56 mstruebing joined
16:57 insitu joined
16:58 Dr8128 joined
16:59 meandi joined
16:59 Durbley joined
17:00 abhiroop joined
17:01 fgaz joined
17:01 <paolino> is it correct that unfoldr makes more code than explicit recursion ?
17:01 Ferdirand joined
17:02 jrajav joined
17:02 <kuribas> :t unfoldr
17:02 <lambdabot> (b -> Maybe (a, b)) -> b -> [a]
17:02 bhiliyam joined
17:02 connrs joined
17:02 dennisvennink joined
17:03 <paolino> mh, unless you have the (b -> Maybe (a, b)) for other reasons :-)
17:06 Sh4rPEYE joined
17:06 jer1 joined
17:07 oisdk joined
17:08 <kuribas> > unfoldr (\x -> guard (x /= 0) >> Just (intToDigit (digitTox `quot` 10), x `div` 10)) 2341
17:08 <lambdabot> error: Variable not in scope: digitTox :: Int
17:08 <kuribas> > unfoldr (\x -> guard (x /= 0) >> Just (intToDigit (digitToInt `quot` 10), x `div` 10)) 2341
17:08 <lambdabot> error:
17:08 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘Char -> Int’
17:08 <lambdabot> • Probable cause: ‘quot’ is applied to too few arguments
17:08 flatmap13 joined
17:08 JoshS joined
17:08 alex-v joined
17:09 mmachenry joined
17:09 flatmap13 joined
17:09 mizu_no_oto_work joined
17:11 <kuribas> > reverse $ unfoldr (\x -> guard (x /= 0) >> Just (intToDigit (x `rem` 10), x `div` 10)) 2341
17:11 <lambdabot> "2341"
17:13 codesoup joined
17:13 <paolino> kuribas, guard is an ace
17:13 spatial joined
17:15 merijn joined
17:15 <spatial> A basic question. Why is pattern matching considered a functional concept ?
17:15 carlosda1 joined
17:15 descender joined
17:16 thatguy joined
17:16 <kuribas> > let f y x | x == 0 = y | otherwise = f (intToDigit (x `rem` 10):y) (x `div` 10) in f [] 2341
17:16 <lambdabot> "2341"
17:17 sproingie joined
17:17 ludat joined
17:17 <kuribas> spatial: is it?
17:18 asmyers joined
17:18 prae joined
17:18 <Cale> spatial: It's more historical than anything -- algebraic data types come out of the same approaches to mathematical logic that we get lambda from.
17:19 <Cale> I suppose that doesn't exactly get you as far as pattern matching, but you need something to match before you can have pattern matching :)
17:19 Discovery joined
17:19 <spatial> Was curious. Java 10 has such a proposal.
17:20 abhiroop joined
17:21 flatmap13 joined
17:22 <Cale> spatial: In logic, if you want to prove the implication A -> B, you typically start by assuming A, and then try to prove B, and then if you're successful, by natural deduction, conclude A -> B
17:22 C-16 joined
17:22 carlomagno joined
17:22 <Cale> spatial: In lambda calculus, if you want to construct a function of type A -> B, you start by introducing a variable x of type A, and try to construct some term e of type B
17:22 gawen joined
17:22 Dr8128 joined
17:23 <Cale> and then if you're successful, you can form the lambda term (λx. e) of type A -> B
17:23 <spatial> Cale: You mean the roots are in math ?
17:23 <Cale> Yeah, what I'm hinting at here is a connection between logic and lambda calculus
17:24 raichoo joined
17:24 <Cale> This actually can be carried through to the introduction and elimination rules for all of (intuitionistic) logic.
17:24 <seequ_> Also pattern matching is a very functional way to decompose structures, compared to manually checking variants and picking out values
17:25 cpennington joined
17:25 <Cale> Logical conjunction (and) corresponds to pairs, and gives the basic pattern for product types
17:25 <seequ_> And of course was introduced in functional languages, which is a big part of it
17:25 abhiroop joined
17:25 <Cale> Disjunction (or) corresponds to what we call Either in Haskell, and gives the pattern for sum types
17:26 <Cale> and as I mentioned, implication corresponds to function types
17:26 oisdk joined
17:27 sid_fules joined
17:28 jer1 joined
17:28 <Cale> It's sort of funny that functional programming languages ended up being called that, and logical programming languages came to refer to something different.
17:28 <Cale> The type systems of functional programming languages correspond very directly to logics of various sorts.
17:29 eschnett joined
17:29 davama joined
17:29 <Cale> But of course, first class functions are pretty important to the way we actually write programs, so it's not that strange :)
17:30 abhiroop joined
17:30 davama joined
17:30 davama left
17:30 <eschnett> i want to define a type class that has an associated type (?), and that type should be an instance of functor
17:30 <eschnett> like this: <https://gist.github.com/eschnett/5e7abcd9153619ee324c49137fead2e3>
17:30 <dolio> Functional programming is propositional programming.
17:31 <dolio> Logic programming is judgmental programming.
17:31 <eschnett> what is the right definition for this?
17:31 allenj12 joined
17:31 ixxie joined
17:31 <eschnett> the “instance” keyword in the class definition isn’t accepted.
17:31 <lyxia> eschnett: class Functor (Bnd m) => Manifold m
17:31 somewone joined
17:31 <glguy> eschnett: class Functor (Bnd m) => Manifold m
17:31 slomo joined
17:31 slomo joined
17:32 <glguy> also type Bnd Grid a = GridBnd a should probably be: type Bnd Grid = GridBnd
17:32 gcross_ joined
17:32 <eschnett> thanks!
17:33 meoblast001 joined
17:35 paolino joined
17:37 danthemyth joined
17:37 blender joined
17:37 ragepandemic joined
17:37 sid_fules joined
17:38 replay joined
17:40 carlomagno joined
17:42 paolino_ joined
17:43 radisson joined
17:44 Sh4rPEYE joined
17:45 GGMethos joined
17:45 SpinTensor joined
17:46 xmonader joined
17:47 paolino__ joined
17:47 alx741 joined
17:48 jer1 joined
17:49 PennyNeko joined
17:49 unK_ joined
17:50 Prutheus joined
17:52 peterbecich joined
17:55 a3Dman joined
17:55 a3Dman joined
17:56 afarmer_ joined
17:56 connrs joined
17:57 sid_fules joined
17:57 meandi joined
17:59 Javran joined
17:59 safe joined
18:00 asmyers joined
18:01 Younder joined
18:01 <ski> dolio : elaborate ?
18:02 hybrid joined
18:03 jshjsh joined
18:04 paolino__ joined
18:04 flatmap13 joined
18:04 balor joined
18:04 somewone joined
18:06 danthemy_ joined
18:06 <dolio> ski: In functional programming, you use logic to define a term T such that |- T (or what have you), so T is like a proposition, and computation is defined for these 'propositions'.
18:06 massimo_zaniboni joined
18:07 <dolio> ski: In logic programming, you are giving a bunch of inference rules between judgments G |- P, and the computation is using your inference rules to find a proof of a judgment.
18:08 yogsototh joined
18:09 jer1 joined
18:09 <ski> dolio : does that apply to e.g. lambdaProlog as well ?
18:10 <dolio> I think so.
18:10 iomonad joined
18:10 <dolio> I'm no expert, though.
18:10 manoflags joined
18:11 <ski> i'm not quite getting the logic programming connection with inference rules, there
18:11 <dolio> Lambda prolog just gives you a richer proposition language for your judgments, I think.
18:11 uglyfigurine joined
18:11 balor_ joined
18:12 Gentilhomme joined
18:12 JoshS joined
18:12 refold joined
18:13 <ski> is this related to the judgements-as-types paradigm, in e.g. Twelf, <http://twelf.org/wiki/Judgment> ?
18:13 <dolio> Maybe that's not a good description. Maybe a better one is that you give axiom judgments and it tries to cut them together?
18:13 roconnor joined
18:13 zcourts joined
18:14 <ski> well, that would correspond to resolution in Prolog, i think
18:14 manoflags joined
18:15 __main__ joined
18:15 <ski> but the semantics of lambdaProlog isn't given in terms of adding the negation of the query as an axiom, and trying to deduce the empty (absurd) judgement -- it's given in terms of a direct (though focused) proof search, ND-style
18:16 carlosda1 joined
18:16 massimo_zaniboni left
18:16 <dolio> I mean, part of the problem is that there are kind of correspondences between a lot of stuff. Inference rules vs. judgments. vs hypothetical propositions.
18:16 <JoshS> Great my virus scanner says manoflag's sign off is malware and it wants to restart my computer to remove #haskell's log
18:16 <JoshS> that's pretty sneaky
18:16 <ski> dolio : yes .. so it's not clear to me where the distinction you're talking about really lie ..
18:16 <dsh> JoshS, i just got the same thing
18:17 <dsh> i was like wtf
18:17 <JoshS> someone needs to ban him for that
18:17 <dsh> for serious
18:17 dmj` joined
18:18 <kadoban> Heh, what'd they do, put some virus signature in their part message? I have parts hidden.
18:18 jangsutsr joined
18:18 <dsh> kadoban, it looks like it
18:18 <dsh> oddly enough no virus scanner on virus total detects it
18:18 <dsh> perhaps it's tripping heuristics only
18:18 boombanana joined
18:18 <JoshS> window's defender does
18:19 <kadoban> That's rather funny, but ya I suppose it's a bit antisocial too xD
18:19 <dsh> JoshS, yeah microsoft security essentials does for me
18:19 <dsh> but not when virustotal runs MSE
18:19 pgiarrusso_ joined
18:19 mada joined
18:19 <JoshS> it's a little bit of javascript, a reference to a malware site
18:20 <Sornaensis> lol
18:20 <JoshS> lol
18:20 <Sornaensis> you're using webchat?
18:20 <JoshS> no
18:20 <JoshS> I'm using hexchat
18:20 <dsh> hexchat with logging
18:20 <JoshS> yeah
18:20 <JoshS> :3 lol I won't miss the #haskell log
18:21 <dolio> ski: Anyhow, in most functional languages, proof search is type checking/inference. In logic languages, proof search is the primary form of computation.
18:21 <JoshS> I'm not sure why I'm in here, I've never used haskell, I just have an interest in programming languages in general
18:21 <dsh> i love haskell but i never use it
18:21 carlomagno joined
18:21 <Sornaensis> I use haskell but don't love it
18:22 <dsh> lol i wonder if that K-Lined is legit
18:22 <JoshS> I tend to prefer dynamically typed languages when I'm not going for to-the-metal
18:22 <dolio> But in logic languages with types, I guess you might have two proof searches.
18:22 saurabhnanda joined
18:22 carlomagno joined
18:22 balor__ joined
18:23 meoblast joined
18:23 <JoshS> Someone said to me the other day that when you're programming in Haskell, you have to come up with the types before you come up with the algorithm. I don't think I'll ever get the hang of that
18:23 <geekosaur> that will be real, yes; freenode is pretty good about prefixing the actual source
18:23 <dsh> depends on what you mean by dynamic but static typing is the best
18:23 <Cale> JoshS: You don't *have* to, but it can be helpful
18:23 <dsh> in dynamic languages you need to do that too though if you want to implement the algorithm well
18:23 <Sornaensis> usually you start out by thinking of what you are mapping to and from
18:23 <JoshS> Well I like scheme except for the syntax. I like lua but it's not quite as powerful as scheme...
18:23 <Cale> JoshS: and sure, you'll get used to it if you use the language for a while and make sure to write the types down.
18:24 <Sornaensis> and then that turns into types, and then code
18:24 <geekosaur> it;d be "Quit: ..." if they were trying to make their quit message look like a k-line. that works on other irc networks but not freenode because of the prefix indicating it was an actual quit
18:24 <dsh> geekosaur, neat
18:24 <dolio> That isn't all that odd, though, because you can have many sorts of judgments in a presentation of logic/type theory.
18:24 <nshepper1> JoshS: that's a rather classic trick. Like the ATH0 thing https://everything2.com/title/%252B%252B%252BATH0
18:24 <Sornaensis> that site doesn't even resolve for me
18:24 <JoshS> I tried writing something in lua for a couple months and it turned out TOO SLOW, and I'm starting over in c++ and weirder things, an in-memory C compiler for scripting. Sometimes nothing is fast enough
18:25 meoblast001 joined
18:25 <JoshS> That project is a general gaming thing. Scriptable board games.
18:25 <Cale> JoshS: Personally, I have a hard time beginning to write any code without having a pretty clear idea of the type of thing that it is that I'm trying to write.
18:26 <Cale> At least locally :)
18:27 <JoshS> It depends. If the algorithm is new, and you're overwhelmed with complexity, it's nice to have nothing to think about other than the algorithm
18:27 <JoshS> if you have to think about types too, thats a little more complexity on top of it, and you can trip over them
18:27 balor__ joined
18:28 <kadoban> Coming up with the types for an algorithm is usually fairly trivial, or at least no more work than coming up with the data structures involved, which you'd have to do anyway.
18:29 <kadoban> Haskell is actually my favorite language for playing with algorithms and data structures, it makes it really nice to express them usually.
18:30 <JoshS> It's not consistent. Sometimes types help you keep things organized. Sometimes they get in your way. If you don't do the kind of programming where you get in way over your head you're they won't get in the way
18:30 <JoshS> I like to get in over my head >.>
18:31 <allenj12> does anyone know of a haskell(ish?) language that is actually a lisp?
18:31 <kadoban> I'm in over my head most of the time recently ... been doing a lot of competitive programming recently.
18:31 <JoshS> But as a principle, there's something nice about "you don't type anything in your program that isn't the algorithm"
18:31 <JoshS> I'm writing my first compiler. I'm pretty overwhelmed
18:32 twanvl joined
18:32 HahaGotcha joined
18:32 <JoshS> I've greenspun's 10th on the problem. My parser generates s-expressions that are programs that compile the program >.>
18:33 govg joined
18:33 <JoshS> So yeah, I basically wrote a lisp
18:34 <JoshS> It's a little weirder because the expressions are fexpressions so I can control the order in which I evaluate tree nodes and whether i evaluate them at all
18:34 <JoshS> http://lambda-the-ultimate.org/node/5424
18:35 soniku joined
18:36 Itkovian joined
18:36 <dolio> I don't think what you're saying makes any sense to me, anymore.
18:36 bennofs1 joined
18:37 <JoshS> lol, yeah
18:37 baldrick1 joined
18:37 <JoshS> an fexpression is a function that doesn't evaluate its arguments. But it's handed an environment and you can manually evaluate them as needed.
18:38 <dolio> No, I understand fexpressions.
18:38 <dolio> Well, somewhat.
18:39 <Sornaensis> is lambda the ultimate still written in PHP
18:39 <JoshS> in that post I linked, I explained that a problem with a parser generator is that it evaluates actions in an order that has to do with when it recognizes
18:40 <ski> dolio : aye
18:40 BlueRavenGT joined
18:40 <JoshS> but when you're generating code, that isn't the order you want to walk the tree in
18:40 a3Dman joined
18:40 balor__ joined
18:41 <Sornaensis> what do you mean
18:41 <JoshS> So if the tree is recast as a s-expression full of fexprs you can walk it in a controlled order in one pass
18:41 <nshepper1> Why use a parser generator that runs actions when you can just build an ast
18:41 Mutter joined
18:41 <Sornaensis> You just build the tree
18:41 jeltsch joined
18:41 jao joined
18:41 balor_ joined
18:42 <JoshS> parser generators don't actually make abstract syntax trees, they make concrete syntax trees that follow the grammar
18:42 <balor_> Given a `[Maybe Int]` does it make sense to be allowed to transform it into a `Maybe [Int]`?
18:42 <JoshS> an abstract syntax tree would be one that follows the semantics not the grammar
18:42 steeze joined
18:42 fizruk joined
18:42 <JoshS> but once you have the tree, then you have to process it
18:43 <JoshS> in this case I'm building a tree that knows how to process itself
18:44 ragepandemic joined
18:45 sid_fules joined
18:46 <tsahyt> are there any benchmarks of trifecta vs attoparsec?
18:47 balor__ joined
18:50 <cocreature> balor_: sure that function is called "sequence"
18:50 <ski> @type sequence :: [Maybe Int] -> Maybe [Int]
18:50 <lambdabot> [Maybe Int] -> Maybe [Int]
18:50 <ski> @type (\xs -> let ys = catMaybes xs in if null ys then Nothing else Just ys) :: [Maybe Int] -> Maybe [Int]
18:50 <lambdabot> [Maybe Int] -> Maybe [Int]
18:50 <ski> balor__ : any of those ^ ?
18:50 tswe_tt joined
18:50 <cocreature> balor_: obviously you lose information in that process but if that’s fine in your usecase then by all means go ahead
18:50 <balor__> ski, thanks
18:50 <ski> the first of them gives `Nothing' in case any element of the input list was `Nothing'
18:51 <ski> the second gives `Nothing' only in case no element in the input list was of the form `Just (...)'
18:52 gehmehgeh joined
18:52 meandi joined
18:53 sid_fules joined
18:53 shivansh joined
18:53 meoblast001 joined
18:54 forgottenone joined
18:54 tomphp joined
18:55 <Sornaensis> > 3^9/2^
18:55 <Sornaensis> > 3^9/2^9
18:55 <lambdabot> <hint>:1:7: error:
18:55 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
18:55 <lambdabot> 38.443359375
18:56 <jackhill> Hi, I have some (I think) pretty simple XML that I would like to parse into Haskell data so I can play around with in in the REPL to see what's there. What XML library would you recommend?
18:57 shivansh left
18:58 justin3 joined
18:58 <cocreature> jackhill: I’ve used xml-conduit in the past and it worked pretty well for me
18:59 <jackhill> cocreature: thanks!
19:00 jaziz joined
19:01 amut joined
19:02 bhiliyam joined
19:02 fgaz joined
19:03 xinming joined
19:05 a3Dman joined
19:06 tomphp joined
19:07 mikecaruso joined
19:13 sid_fules joined
19:13 butterthebuddha joined
19:14 suck joined
19:15 blow_ joined
19:15 TheLemonMan joined
19:16 blow_ joined
19:16 carlosda1 joined
19:16 hsiktas joined
19:21 amut joined
19:22 __main__ joined
19:23 Dykam joined
19:23 insitu joined
19:23 eschnett joined
19:24 Skami joined
19:26 Achylles joined
19:27 yogsotot_ joined
19:27 `^_^v joined
19:28 <tsahyt> Is there any package providing generalized algorithms for local search?
19:28 a3Dman joined
19:28 a3Dman joined
19:28 <tsahyt> I'm just looking for project ideas, and a quick hackage search didn't yield anything usable
19:28 butterthebuddha joined
19:29 <tsahyt> nvm, there is one
19:30 <Cale> tsahyt: What do you mean by "local search"? Does A* fit that?
19:30 <tsahyt> Cale: no. in the terminology I learned, local search refers to things such as hill climbing, simulated annealing, etc
19:30 <Cale> ah, okay
19:31 <Cale> So nonlinear optimisation sorts of things
19:31 <tsahyt> yeah that'd be one application
19:31 <tsahyt> genetic algorithms also fall into that category. it's really very broadly applicable
19:32 ichor joined
19:32 <cocreature> tsahyt: which library did you find?
19:32 <tsahyt> http://hackage.haskell.org/package/local-search
19:33 <tsahyt> it's an interesting approach too
19:33 <tsahyt> with that stream type underneath
19:33 afarmer joined
19:34 kmels joined
19:34 NeverDie_ joined
19:35 ph88 joined
19:35 hackebeilchen1 joined
19:35 orhan89 joined
19:35 <cocreature> neat
19:35 <tsahyt> seems unmaintained though. the project page leads nowhere too
19:36 <cocreature> it has a surprising amount of documentation for an older, unmaintained haskell library :)
19:37 hackebeilchen2 joined
19:38 m3adi3c joined
19:38 <tsahyt> judging by the project URL it originated from academia. that makes the documentation even more surprising
19:39 dfeuer joined
19:40 steeze joined
19:42 mkoenig joined
19:42 argent0 joined
19:45 ragepandemic joined
19:46 sid_fules joined
19:47 phaji joined
19:47 yellowj joined
19:47 epsilonhalbe joined
19:48 sheogorath joined
19:48 butterthebuddha joined
19:50 IanKelling joined
19:51 eschnett joined
19:53 acowley_away joined
19:53 peterbec` joined
19:55 infinity0 joined
19:55 cloudhead joined
19:57 meandi joined
19:57 steeze joined
19:58 sid_fules joined
20:00 Wuzzy2 joined
20:00 _sg joined
20:01 takle joined
20:01 geekosaur joined
20:02 tzh joined
20:03 meck joined
20:05 takle joined
20:06 LHoT10820 joined
20:06 steeze joined
20:07 latro`a joined
20:08 Swizec joined
20:09 unK_ joined
20:09 sirreal joined
20:10 mp2234 joined
20:10 ralu joined
20:11 saurabhn_ joined
20:13 fnurglewitz joined
20:17 carlosda1 joined
20:18 ubsan_ joined
20:19 Sindriava joined
20:25 butterthebuddha joined
20:27 matt179 joined
20:27 isidore joined
20:30 sid_fules joined
20:31 takle_ joined
20:31 <adamCS> Hello all. Is there a way to give an argument to a function such that , for any a in some given list of type level lists xss, and two given functors, f and g, there is a function f a -> g a? I know I can do it as a constraint (the machinery in the generics-sop package does this with something like "All2 (HasFunction f g) xss" with "class HasFunction f g where do::f a -> g a") but I'd rather not burden the caller with
20:31 <adamCS> creating an instance of a class just to use the machinery.
20:31 <jle`> adamCS: you're looking for (forall a. f a -> g a)
20:32 <adamCS> jle':Except, not for all a
20:32 <adamCS> jle`:
20:32 <adamCS> sorry
20:32 __mu__ joined
20:32 <adamCS> just the a in xss
20:32 <cocreature> adamCS: is it ok if the caller needs to pass a list of those functions?
20:32 <jle`> what is an example of xss
20:32 insitu joined
20:33 <jle`> what is its kind?
20:33 <jle`> [[k]]?
20:33 <adamCS> cocreature: I'm interested in any way to do it and then I can zero in on a better interface if there is one
20:33 <adamCS> xss :: [[*]]
20:33 <adamCS> I mean, higher kinded would be okay too
20:33 <adamCS> but I'd be content with *
20:33 <jle`> why not just [*] ?
20:33 <cocreature> adamCS: also should that class me "HasFunction f g a where do :: f a -> g a"? without the a it seems wrong
20:33 <adamCS> cocreature: yes
20:33 <adamCS> sorry!
20:34 Ozymandy joined
20:34 <jle`> it makes more sense to me to expect a type a in a list of types
20:34 <Ozymandy> How to add two numbers to the end of array?
20:34 <adamCS> jle`: Good point. I already have the xss in that form but some of this maybe some dictionary re-arranging anyway?
20:34 <Ozymandy> And to the start
20:35 <jle`> if you get a [[*]], you can just concatenate it
20:35 <jle`> Ozymandy: what array type are you using?
20:35 <jle`> Data.Array?
20:35 <Ozymandy> Integer
20:35 <jle`> that's not an array :'(
20:35 <Ozymandy> so what is it?
20:35 <EvanR> godel said you can implement anything with Integer!
20:35 <jle`> that's just an Integer
20:36 <jle`> it's not an array of anything
20:36 <jle`> it's just lik...6, or 10
20:36 <Ozymandy> Hmm, well so how? can you write code for me? I'm failed on it
20:36 <jle`> or maybe even 30
20:36 <jle`> Ozymandy: we need to know what type of array you are working with
20:36 <adamCS> jle`: Yeah. Some of this is my confusion. I will, eventually, need to be able to express it as "HasFunction f g a" at each a when the function is used.
20:36 <jle`> so we can know how to work with that array
20:36 <jle`> adamCS: you can do something like (forall a. Sigma a -> f a -> g a)
20:36 <EvanR> Ozymandy: do you mean a list
20:36 <Ozymandy> jle`: Just I have number list and I need add two numbers to the end
20:36 <adamCS> and the way the function will be used is in a product of products indexed by the xss
20:37 <jle`> Ozymandy: do you mean [Integer], maybe?
20:37 <Ozymandy> [2,3,5,]
20:37 <Ozymandy> this
20:37 <jle`> Ozymandy: ah yeah, so you're using a List
20:37 <monochrom> You can add a digit to the end of an Integer by (\x -> x*10 + digit)
20:37 sprfnk joined
20:37 <adamCS> jle`: What's Sigma there?
20:37 <EvanR> > [1,2] ++ [3,4,5,6] ++ [7,8]
20:37 <lambdabot> [1,2,3,4,5,6,7,8]
20:37 soniku joined
20:37 <jle`> er sorry, i mean (forall a. Sigma as a -> f a -> g a)
20:37 <Ozymandy> Ok, but how to add to the start?
20:37 <Ozymandy> of list
20:37 <Sornaensis> > 1 : [2,3]
20:37 <lambdabot> [1,2,3]
20:38 <jle`> Ozymandy: [1,2] ++ myList
20:38 <Ozymandy> source_file.hs:1:1:
20:38 <Ozymandy> Couldn't match expected type ‘IO t0’ with actual type ‘[Integer]’
20:38 <Ozymandy> In the expression: main
20:38 <Ozymandy> When checking the type of the IO action ‘main’
20:38 <jle`> Ozymandy: paste your entire code
20:38 <jle`> adamCS: some way to choose from the list
20:38 <EvanR> not in the channel
20:38 <Sornaensis> please use lpaste
20:38 <jle`> you can use 'Index' from type-combinators, which is the same
20:38 <Ozymandy> jle`: I have no code now.
20:39 <jle`> Ozymandy: where did your error come from then?
20:39 skeet70 joined
20:39 <cocreature> adamCS: does something like this help http://lpaste.net/354781 ?
20:39 <Ozymandy> jle`: http://rextester.com/l/haskell_online_compiler from here. I just type that code with ++
20:40 <cocreature> adamCS: Rec f g as is then a type that contains the functions for all a in as
20:40 <jle`> adamCS: http://hackage.haskell.org/package/type-combinators-
20:40 <monochrom> main = print $ [1,2] ++ [3,4,5,6] ++ [7,8]
20:40 <jle`> adamCS: so you'd have (forall a. Index as a -> f a -> g a)
20:40 sprfnk joined
20:41 <adamCS> cocreature: Yes! Hmm.
20:41 <adamCS> jle`: And that!
20:41 <jle`> @let data Index as a where IZ :: Index (a ': as) a; IS :: Index as a -> Index (b ': bs) a deriving Show
20:41 <lambdabot> .L.hs:233:15: error:
20:41 <lambdabot> Ambiguous occurrence ‘Index’
20:41 <lambdabot> It could refer to either ‘Lens.Index’,
20:41 <jle`> aw
20:41 <jle`> @let data Index' as a where IZ :: Index' (a ': as) a; IS :: Index' as a -> Index' (b ': bs) a deriving Show
20:41 <lambdabot> .L.hs:235:14: error:
20:41 <lambdabot> • Can't make a derived instance of ‘Show (Index' as a)’:
20:41 <lambdabot> Constructor ‘IZ’ has existentials or constraints in its type
20:42 <jle`> @let data Index' as a where IZ :: Index' (a ': as) a; IS :: Index' as a -> Index' (b ': bs) a
20:42 <lambdabot> Defined.
20:42 <Ozymandy> Thank you!
20:42 ChaiTRex joined
20:42 <jle`> @let type UniNatTrans as f g = forall a. Index as a -> f a -> g a
20:42 <lambdabot> .L.hs:236:38: error:
20:42 <lambdabot> • Expecting one fewer argument to ‘Index as’
20:42 <lambdabot> Expected kind ‘k0 -> *’, but ‘Index as’ has kind ‘*’
20:42 <jle`> @let type UniNatTrans as f g = forall a. Index' as a -> f a -> g a
20:42 <lambdabot> Defined.
20:42 Boomerang joined
20:43 rleppink joined
20:43 <jle`> :t foo :: UniNatTrans '[Int,Bool] List Maybe; foo = \case IZ -> Just . sum; IS IZ -> \_ -> Nothing
20:43 <cocreature> I’m always surprised that lambdabot has the extensions enabled for that kind of madness
20:43 <lambdabot> error: parse error on input ‘;’
20:44 <jle`> @let untTest :: UniNatTrans '[Int,Bool] List Maybe; untTest = \case IZ -> Just . sum; IS IZ -> \_ -> Nothing
20:44 <lambdabot> .L.hs:238:37: error:
20:44 <lambdabot> • Pattern synonym ‘List’ used as a type
20:44 <lambdabot> • In the second argument of ‘UniNatTrans’, namely ‘List’
20:44 <jle`> heh
20:44 <jle`> @let untTest :: UniNatTrans '[Int,Bool] [] Maybe; untTest = \case IZ -> Just . sum; IS IZ -> \_ -> Nothing
20:44 <lambdabot> Defined.
20:44 <jle`> > untTest IZ [1,2,3]
20:44 <lambdabot> Just 6
20:44 <jle`> > untTest IS [True, False]
20:44 <lambdabot> error:
20:44 <lambdabot> • Couldn't match expected type ‘Index' '[Int, Bool] Bool’
20:44 <lambdabot> with actual type ‘Index' as0 a0 -> Index' (b0 : bs0) a0’
20:44 eazar001 joined
20:44 <jle`> > untTest (IS IZ) [True, False]
20:44 <monochrom> madness magnus :)
20:44 <lambdabot> Nothing
20:44 <EvanR> untzTest?
20:45 <adamCS> jle`, cocreature: I like both these ideas. And I think they both point to more or less the same thing; use the same machinery that holds all the rest of the data indexed by these lists to hold all the functions. Now I need to wrap that up so that the constraint version works too.
20:45 <jle`> > untTest (IS IZ) [1,2] -- should be an error
20:45 <lambdabot> Nothing
20:45 <jle`> aw man
20:45 ragepandemic joined
20:46 <jle`> @let untTest2 :: UniNatTrans '[Int,Bool] [] Maybe; untTest2 = \case IZ -> Just . sum; IS IZ -> Just . and
20:46 <lambdabot> .L.hs:248:18: error:
20:46 <lambdabot> • Could not deduce: a ~ Bool
20:46 <lambdabot> from the context: as ~ (a : as1)
20:46 <jle`> i guess Index isn't strong enough
20:47 <jle`> oh, i defined it wrong initially :'(
20:47 <jle`> @undefine
20:47 <lambdabot> Undefined.
20:47 <cocreature> seeing jle` repeatedly fight lambdabot reminds me of when I was guessing de bruijn indices for an ocaml coq plugin an hour ago
20:47 <jle`> @let data Index' as a where IZ :: Index' (a ': as) a; IS :: Index' as a -> Index' (b ': as) a
20:47 <lambdabot> Defined.
20:48 <jle`> @let type UniNatTrans as f g = forall a. Index' as a -> f a -> g a
20:48 <lambdabot> Defined.
20:48 <jle`> @let untTest2 :: UniNatTrans '[Int,Bool] [] Maybe; untTest2 = \case IZ -> Just . sum; IS IZ -> Just . and
20:48 <lambdabot> Defined.
20:48 <jle`> > untTest2 (IS IZ) [1,2] -- should be an error
20:48 <lambdabot> error:
20:48 <lambdabot> • No instance for (Num Bool) arising from the literal ‘1’
20:48 <lambdabot> • In the expression: 1
20:48 <jle`> :)
20:49 replay joined
20:50 takle joined
20:53 mstruebing joined
20:53 <* jle`> . o O ( Index as a ~ Sum (a :~:) as )
20:54 Salih_ joined
20:54 douglascorrea joined
20:54 butterthebuddha joined
20:54 <adamCS> jle`: huh?
20:55 <jle`> adamCS: cocreature's version is a skolemized version of mine i believe
20:55 <butterthebuddha> How do I pattern match something like "E 25 25 str" to get the 25 and 25 out as integers and str out as a string?
20:55 <jle`> adamCS: oh, that's the common Sum type
20:55 <butterthebuddha> I believe something like num:rest_of_string only pattern matches a single character
20:55 <jle`> butterthebuddha: case E 25 25 str of E x y s -> ...
20:55 <butterthebuddha> 25 & 25 could be any number
20:55 <jle`> yes
20:56 <jle`> case myEThing of E x y s -> ...
20:56 mizu_no_oto_work joined
20:56 <jle`> or foo (E x y s) = ...
20:56 <jle`> adamCS: it's basically chained Either's
20:56 StoneToad joined
20:56 <jle`> adamCS: Sum f [a,b,c] is a sum between f a, f b, and f c
20:56 <adamCS> jle`: ah
20:56 NoCreativity joined
20:56 <butterthebuddha> jle` where "foo" is a function?
20:57 Salih joined
20:57 <jle`> i'm defining a function called 'foo' there
20:57 <butterthebuddha> "parseMessage ('E' x y s)" <- that's giving me an error
20:57 <jle`> parseMessage (E x y s) = ...
20:58 <butterthebuddha> Yeah but I want to pattern match the character E
20:58 <butterthebuddha> It could be a different character
20:58 <jle`> oh, are you matching on the actual string?
20:58 <jle`> i thought E was a constructor here, heh
20:59 <jle`> you can unwords
20:59 <butterthebuddha> Nah, the string is something liek "E num num message"
20:59 <jle`> i see
20:59 <jle`> *words
20:59 <jle`> foo (words->'E':x:y:s:[]) = ....
20:59 <jle`> that gets x, y, and s as strings
21:00 burtons_ joined
21:00 <jle`> > case words "E 25 25 str" of 'E':x:y:s:[] -> (read x, read y, s)
21:00 <lambdabot> error:
21:00 <lambdabot> • Couldn't match type ‘Char’ with ‘[Char]’
21:00 <lambdabot> Expected type: String
21:00 sid_fules joined
21:00 <jle`> > case words "E 25 25 str" of "E":x:y:s:[] -> (read x, read y, s)
21:00 <lambdabot> (*Exception: Prelude.read: no parse
21:00 <butterthebuddha> jThat's giving me an Illegal view pattern error :/
21:00 <jle`> ah, sorry, yeah, i was using some syntactic sugar there that's not on by default
21:01 <jle`> but you can use 'words' to split that string into its words
21:01 <jle`> > words "E 25 25 str"
21:01 <lyxia> you aren't using view patterns
21:01 <lambdabot> ["E","25","25","str"]
21:01 <jle`> > case words "E 25 25 str" of "E":x:y:s:[] -> (read x, read y, s) :: (Int, Int, String)
21:01 <lambdabot> (25,25,"str")
21:01 <lyxia> most likely butterthebuddha's syntax is wrong
21:01 <jle`> i used viewpatterns a few lines up
21:01 <lyxia> ah
21:01 <lyxia> nvm
21:01 <ski> > [(x,y,s) | let s0 = "E 25 25 str",("E",s1) <- lex s0,(x,s2) <- (reads :: ReadS Integer) s1,(y,s) <- (reads :: ReadS Integer) s2]
21:01 <lambdabot> [(25,25," str")]
21:02 <ski> butterthebuddha ^
21:02 bhiliyam joined
21:05 danthemyth joined
21:05 <ski> butterthebuddha : .. fwiw, can any of the integers be negative, and are they wrapped in brackets in that case ?
21:05 ccomb joined
21:06 uglyfigurine joined
21:06 <* ski> suspects not
21:07 uglyfigurine joined
21:08 ragepandemic joined
21:08 Ebuc joined
21:09 <Ebuc> Hello
21:09 <Ebuc> Anybody?
21:09 <lambdabot> Hello.
21:09 <* Clint> pats lambdabot on the head.
21:10 <ski> @botsnack
21:10 <lambdabot> :)
21:11 <Ebuc> Do you know if I have integrated graphics card I can add second monitor to my laptop without lags?
21:11 <* ski> waits to see whether Ebuc has any question
21:11 <ski> .. well, a Haskell-related question, perhaps ?
21:11 <glguy> Ebuc: Oops, wrong channel. This channel is for the Haskell programming language
21:11 <Ebuc> How integrated graphics card work?
21:12 tomphp joined
21:12 <Ebuc> oh sorry
21:12 <Ebuc> do you know which channel is best for me?
21:12 <ski> perhaps if you join ##graphics, they could suggest a more appropriate channel to ask in
21:12 <glguy> Ebuc: This isn't a directory service channel either, actually
21:12 <Ebuc> Okay, thanks ski
21:12 <ski> or perhaps a channel related to what Operating System you're running
21:13 <Ebuc> ok thanks
21:13 <Ebuc> and apologize for my questions
21:14 meck joined
21:15 Ebuc left
21:15 coot__ joined
21:15 safe joined
21:17 ompaul joined
21:18 carlosda1 joined
21:18 bjz joined
21:21 sid_fules joined
21:21 abhiroop joined
21:26 coot__ joined
21:27 <cheshircat> Does anyone have a solution for either intero or ghc-mod in a nix shell?
21:27 laplacian joined
21:28 baldrick1 joined
21:29 darjeeling_ joined
21:30 replay joined
21:30 matt179 joined
21:30 <nitrix> unable to decommit memory: Invalid argument
21:31 <nitrix> I'm having a curious problem with GHC on a new system.
21:32 bperez joined
21:33 anuxivm joined
21:33 cables joined
21:35 butterthebuddha joined
21:35 epsilonhalbe left
21:36 <bperez> Trying to get a ghc plugin up and running and having some issues. When I type "ghc --fplugin=MyPlugin" into the command line I get the error: "Module imports form a cycle: module ‘BindWithLoc’ (./BindWithLoc.hs) imports itself"
21:36 a3Dman joined
21:36 strykerkkd joined
21:36 <bperez> this seems to happen even with preexisting plugins
21:36 sigmundv__ joined
21:37 orhan89 joined
21:37 e14 joined
21:37 quobo joined
21:38 tomphp joined
21:41 des_ joined
21:42 alx741 joined
21:42 filterfish joined
21:42 Deide joined
21:45 __Myst__ left
21:45 moth joined
21:48 le_frogballs joined
21:48 sid_fules joined
21:50 geppettodivacin joined
21:51 zcourts joined
21:52 thebored joined
21:53 iqubic joined
21:53 <iqubic> hello
21:53 hiratara joined
21:53 <iqubic> Can people see this?
21:53 <iqubic> What name does it show for me?
21:53 <ChaiTRex> iqubic: Yes.
21:53 <ChaiTRex> iqubic: iqubic.
21:54 <iqubic> Cool. That's really good
21:54 <iqubic> I'm trying out a new irc set-up
21:54 locallycompact joined
21:55 xmonader joined
21:57 <iqubic> So, how does one get started with Emacs' Haskell mode?
21:58 nitrix joined
21:59 <dmj`> iqubic: haskell-mode for emacs has a good readme and wiki
21:59 <dmj`> you might still have to pick an indentation mode, but you can get it from elpa / melpa
21:59 <iqubic> I'll look at that.
21:59 <iqubic> What's an indentation mode?
22:00 <nitrix> Is `class Foo c where data Li :: * -> *` valid using TypeFamilies?
22:00 butterthebuddha joined
22:00 <nitrix> https://github.com/iteratee/haskell-tracker/blob/master/Data/Torrent/Bencode.hs#L65
22:00 steeze joined
22:00 <dmj`> iqubic: http://haskell.github.io/haskell-mode/manual/latest/Indentation.html#Indentation
22:00 <nitrix> This is giving me an error but the project seems to indicate it was compiling fine at some point.
22:01 <iqubic> Why is it that I can't view the logs for this channel when browsing to this web page? http://ircbrowse.net/browse/haskell
22:01 <dmj`> nitrix: that would need to be a data family, which type families should enable
22:01 <dmj`> nitrix: what’s the error?
22:01 <iqubic> Is there another place I can look at the logs for this channel, from at least the past week?
22:02 mr_sm1th joined
22:02 <dmj`> iqubic: seems to be a problem with that site, it lost the db connection
22:02 jer1 joined
22:02 <sophiag> ircbrowse has been down for a while
22:02 <iqubic> Is there a different site with a better DB connection.
22:03 <iqubic> I kinda need to view the logs for the past week or so from this channel
22:03 sid_fules joined
22:03 <ChaiTRex> iqubic: Try the tunes.org link in thhe topic.
22:04 <ChaiTRex> iqubic: http://tunes.org/~nef/logs/haskell/?C=M;O=D
22:04 <dmj`> iqubic: if you use irc cloud app, it can email you logs
22:04 <iqubic> I don't
22:04 <iqubic> But that should be good enough for me.
22:05 <iqubic> Now I just have to remember when it was that I talking about my XMonad config.
22:08 <glguy> iqubic: I'd try 2017-04-05.log
22:08 <iqubic> Why do you say that?
22:08 mkoenig joined
22:09 <iqubic> Ah that seems about right for what I need.
22:09 <iqubic> Do All channels keep their logs around?
22:09 steeze joined
22:09 <ChaiTRex> iqubic: Not all.
22:09 <iqubic> Do you think the XMonad channel keeps it's logs around?
22:10 <glguy> Youd want to ask in #xmonad
22:11 <iqubic> I have, no one's answered yet.
22:11 tomphp joined
22:12 abhiroop joined
22:12 stevenxl joined
22:12 stevenxl joined
22:12 stevenxl joined
22:12 hybrid joined
22:16 meba joined
22:18 okuu joined
22:18 pranz1 joined
22:19 carlosda1 joined
22:20 Fairy joined
22:20 isenmann joined
22:21 ExpHP joined
22:24 jer1 joined
22:24 le_frogballs joined
22:25 butterthebuddha joined
22:25 sleffy joined
22:26 albel727 joined
22:27 JoshS joined
22:27 Lazersmoke joined
22:27 takle_ joined
22:28 nilof joined
22:29 meba joined
22:30 mstruebing joined
22:30 Shatnerz joined
22:31 pandeiro joined
22:31 meck joined
22:31 hiratara joined
22:33 sid_fules joined
22:37 testymctestface joined
22:37 <bvad> I'm trying to implement MonadBaseControl for my transformer stack, but I'm kind of stuck. The problem is shown here: http://lpaste.net/227445533667491840 with comments containing the type errors I'm getting
22:37 <bvad> Maybe I'll take that question to #haskell-beginners.. Sorry
22:37 <glguy> bvad: #haskell-beginnners is just a different channel altogether; it's not the beginners area of #haskell. This channel is fine
22:38 <bvad> glguy: Yeah I figured, but I really do feel like a beginner facing this issue
22:39 butterthebuddha joined
22:39 soniku joined
22:39 bennofs joined
22:39 <bitonic> Is it possible to include some data constructor but not the type constructor?
22:39 <glguy> bitonic: Include? Import?
22:40 <bitonic> glguy: yeah, import
22:40 uglyfigurine joined
22:40 <* monochrom> considers creating #democratic-republic-of-haskell-experts-and-beginners-SPQR
22:40 <bitonic> E.g. `import Data.Maybe (Just, Nothing)` (clearly this does not work)
22:40 <Rembane> monochrom: Just do it!
22:41 <monochrom> I think you can't, I think you have to import the type name as well, because it wants you "Type(DataConstructor)"
22:41 bennofs joined
22:44 mkoenig joined
22:44 jer1 joined
22:44 Koterpillar joined
22:48 binaryplease joined
22:49 r1m4n joined
22:49 testymctestface joined
22:49 mkoenig joined
22:50 magneticduck joined
22:50 fgaz joined
22:51 mkoenig joined
22:53 xificurC joined
22:56 <xificurC> tips to using sqlite from haskell? I found 2 options when browsing - persistent and sqlite-simple. Not sure what the general opinion on yesod libs is and if there's another general-purpose DB library I missed
22:56 mkoenig joined
22:57 Iceland_jack joined
22:58 <Hafydd> #democraitc-people-s-republic-?
22:58 e14 joined
22:59 xmonader joined
23:01 soniku joined
23:01 sid_fules joined
23:01 <pacak> xificurC: It's easy to implement your own version if you want to do strange things.
23:02 bhiliyam joined
23:02 abhiroop joined
23:02 markus1209 joined
23:03 markus1219 joined
23:03 meck joined
23:04 <lpaste> glguy annotated “Failing to implement MonadBaseControl” with “This type checks - for bad” at http://lpaste.net/227445533667491840#a354784
23:05 <lpaste> glguy annotated “Failing to implement MonadBaseControl” with “instance for AppLoggingT” at http://lpaste.net/227445533667491840#a354785
23:05 <xificurC> pacak: no strange things, just simple stuff :)
23:05 jer1 joined
23:05 meck joined
23:05 <glguy> bvad: That was supposed to say "- for bvad" but autocorrect ate your name in my browser
23:06 latro`a joined
23:06 <bvad> glguy: everything makes sense now.. Thank you so much!
23:07 theDon_ joined
23:07 <glguy> bvad: I've never needed to use that class, so I'm not sure that that's right. You should test that it does what you expected
23:09 <bvad> glguy: I think it does, but I'm considering getting rid of the newtype wrapper around LoggingT, it's really just there to avoid an ophan instance of MonadAWS
23:12 Fairy joined
23:16 Welkin joined
23:16 sleffy joined
23:17 fakenerd_ joined
23:17 Gurkenglas_ joined
23:19 carlosda1 joined
23:21 e14 joined
23:24 le_frogballs joined
23:24 <LHoT10820> Okay, I'm not making any progress on this. How can I output C from ghc? Only thing I found suggested I add "--enable-unregisterised" to the config, but it's my first time working in haskell and I have no idea where this config exists if it's something I don't make myself.
23:24 indi_ joined
23:25 uglyfigurine joined
23:25 jer1 joined
23:26 <kadoban> LHoT10820: Wait, what are you trying to do? Compile haskell code to C?
23:27 <LHoT10820> Yes.
23:27 <LHoT10820> Why? No good reason, simply curious.
23:27 <kadoban> Don't know if GHC can even do that, IIRC it used to use C as a step in its compilation, but I don't think it even does anymore.
23:28 <geekosaur> unregisterised still generates ANSI C
23:28 <geekosaur> you need to build ghc with that option
23:28 <kadoban> Oh, huh.
23:28 fakenerd joined
23:28 <kadoban> I'm surprised that's even still a feature. Is it used for anything internally?
23:28 <geekosaur> porting
23:28 <kadoban> Ah
23:28 chao-tic joined
23:29 <geekosaur> the code it generates isn't very good, so it;s something of a last resort if you can't do something like use -fllvm and keep temporary files so you can copy llvm bytecode over to the target
23:29 <LHoT10820> So, I would need to rebuild ghc and have --enable-unregisterised in the ghc build config file. Not anything to do with the file I'm building at the moment.
23:30 steeze joined
23:30 __mu__ joined
23:30 bl0w3d_0ut joined
23:30 AfC joined
23:31 Achylles joined
23:31 afarmer_ joined
23:32 <LHoT10820> Am I on the right track?
23:32 connrs joined
23:32 sid_fules joined
23:34 augur joined
23:37 Noldorin joined
23:37 <geekosaur> pretty much
23:38 cyborg-one joined
23:38 orhan89 joined
23:39 <LHoT10820> Great, thanks geekosaur!
23:39 wires joined
23:45 abhiroop joined
23:46 jer1 joined
23:47 newhoggy joined
23:47 lambda-11235 joined
23:48 robertkennedy joined
23:50 moth joined
23:54 YongJoon joined
23:55 infinity0_ joined
23:55 infinity0_ joined
23:57 anuxivm left
23:58 nakal_ joined
23:59 infinity0 joined