<    June 2018     >
Su Mo Tu We Th Fr Sa  
                1  2  
 3  4  5  6  7  8  9  
10 11 12 13 14 15 16  
17 18 19 20 21 _2_2 23  
24 25 26 27 28 29 30
00:00 atk joined
00:01 bydo joined
00:02 kvda joined
00:02 phreedom joined
00:04 conal joined
00:07 fmixing joined
00:08 cybai joined
00:09 bbrodriguez joined
00:09 Kundry_Wag joined
00:09 SkinArt joined
00:10 jwynn6 joined
00:10 SkinArt left
00:10 tangmou joined
00:11 Kundry_Wag joined
00:11 glittershark joined
00:12 dented42 joined
00:16 dogweather joined
00:17 lykrysh joined
00:18 YongJoon joined
00:19 night joined
00:19 bbrodriguez joined
00:19 hucksy joined
00:19 mud joined
00:21 Mrd1 joined
00:21 <Mrd1> Hello
00:22 karlguy joined
00:22 fmixing joined
00:23 <Mrd1> Wellcome
00:23 hucksy_ joined
00:24 ammazza joined
00:25 Vulfe joined
00:26 jez_ joined
00:26 Kundry_Wag joined
00:28 alasi joined
00:28 conal joined
00:29 Arcaelyx joined
00:31 Vulfe joined
00:34 Kundry_Wag joined
00:36 vonfry joined
00:38 dogweather joined
00:38 Kundry_Wag joined
00:40 patlv joined
00:45 emilypi joined
00:50 conal joined
00:50 DasBrain joined
00:53 tabemann joined
00:53 fizbin joined
00:53 <tabemann> I don't know what's wrong with my code here: https://lpaste.net/5268645053542170624 (why can't I make instances like that?)
00:55 <Cale> tabemann: The second instance makes sense.
00:55 <geekosaur> because it can't resolve contexts like that at runtime, and what you compile now may be linked into another program a year later
00:55 <Cale> The first would apply to any type application where you're applying a type to ()
00:55 <geekosaur> all it can use is the type, and a overlaps with IO
00:56 andreabedini joined
00:56 <Squarism> Is there some lib that let me list all timezones?
00:56 <Cale> http://hackage.haskell.org/package/timezone-olson might be useful
00:57 dodong joined
00:57 <tabemann> Cale: what I want is one case for all types of kind * -> * that have MonadIO instances, and then one for IO
00:57 ericsagn1 joined
00:57 <geekosaur> tabemann, that is what you cannot have because it can only check MonadIO after picking the type/instance to use
00:57 <Cale> tabemann: The thing is, the algorithm which selects which instance to use isn't allowed to look at the type class constraints on the instances
00:58 <geekosaur> other code *cannot know* what instances exist.
00:58 <Cale> (for a good reason -- it might not know about all the instances which will be specified in future modules)
00:58 codesoup joined
00:58 <tabemann> the thing is I swear I've seen instance definitions that include stuff like MonadIO a =>
00:58 <Cale> So, if it picked the a () instance under the assumption that there was no more specific instance available, that might immediately become untrue in the next module
00:58 <Squarism> Cale, that require me to point out these "olson" files? I thought this was a standard OS function so that I wasnt required to do such tricks.
00:58 <geekosaur> tabemann, you have. they are checked afterward.
00:59 <* hackage> th-abstraction 0.2.7.0 - Nicer interface for reified information about data types http://hackage.haskell.org/package/th-abstraction-0.2.7.0 (ryanglscott)
00:59 <Cale> Squarism: Yeah, I don't know, that's what we do where I work.
00:59 <geekosaur> Squarism, on unixlike systems this is tzinfo
00:59 codyrutscher_ joined
00:59 <Squarism> Cale, ok good to know. thanks
00:59 sdothum joined
00:59 <tabemann> so, how would I fix my instances, if there is any good way to do this?
01:00 <Cale> tabemann: Make instances of LogContext for each monad you want it for
01:00 <tabemann> yeah, because there is a specific monad I have in mind, but it didn't feel right making an instance just for it when there is an obvious more general case
01:00 cybai joined
01:01 Kundry_Wag joined
01:01 <Cale> You can, using DefaultSignatures, put the implementation you have there into the class declaration
01:01 <tabemann> e.g. it really doesn't matter that it's that monad, but rather that that monad has a MonadIO instance that matters
01:01 kvda joined
01:01 Stanley_00 joined
01:01 <Cale> and then you can just write
01:01 <Cale> instance LogContext MyMonad
01:01 <Cale> whenever you have MonadIO MyMonad
01:02 <dmwit> tabemann: Why do you even have a class for this?
01:02 <Cale> Also, yeah, why is logMessage's type not more specified?
01:02 night joined
01:02 <dmwit> `logMessage string = when logActive (liftIO (putStr string))` works for any `MonadIO`, including `IO` itself.
01:02 <Cale> It seems like it should always be String -> m () at least
01:02 <tabemann> dmwit: because I didn't feel like having two different functions used in different parts of my program
01:02 <dmwit> tabemann: It's not even two different functions, lol. `liftIO = id` for `IO`.
01:03 <Cale> tabemann: You know that IO is an instance of MonadIO too, right?
01:03 <dmwit> It's the same function.
01:03 <tabemann> okay, now I feel stupid
01:03 Stanley00 joined
01:03 Stanley00 joined
01:03 <Cale> I assumed there would be some other monads where you wanted to implement logMessage differently
01:03 <* tabemann> honestly didn't know that IO had a MonadIO instance
01:04 dogweather joined
01:04 <tabemann> Cale: there is another monad I might use with it, but it also has a MonadIO instance
01:04 sdothum_ joined
01:04 <geekosaur> it'd be kinda silly if it didn't, especially when it's such a trivial instance
01:05 jackdk joined
01:05 <dmwit> It would be silly and also difficult to make work. IO is the base case of a recursion. Without it, every instance would have to double up on whether it was "one layer" over IO or many.
01:06 <tabemann> now I feel extra stupid, and rightly so, and will remove my needless use of a type class for this
01:06 <dmwit> e.g. you would need both `instance MonadIO (ReaderT r IO)` and `instance (MonadIO m, IsNotIO m) => MonadIO (ReaderT r m)`... which runs into exactly the same kinds of problems you're running into with this.
01:06 nighty- joined
01:07 <dmwit> (...you would need them both because they would have different implementations of `liftIO`, the former being `lift` and the latter being `lift . liftIO`.)
01:10 <tabemann> I don't know why I didn't just assume that IO had a MonadIO instance, and why I didn't check to confirm whether IO has a MonadIO instance
01:11 <tabemann> because in second thought, as you state, it's obvious that IO should have a MonadIO instance
01:11 patlv joined
01:12 skeuomorf joined
01:13 Azel joined
01:13 MomusInvictus joined
01:14 <tabemann> I don't know why i spent the last week or so hacking on an actor library in Haskell when there's already Cloud Haskell
01:14 Mrd2 joined
01:15 <Mrd2> Hello
01:15 <tabemann> hey
01:15 <Mrd2> ......
01:15 <Mrd2> Hey
01:16 plutoniix joined
01:16 emilypi joined
01:17 <tabemann> (well, it's probably way lighter-weight than Cloud Haskell, but at the same time probably doesn't handle nearly many edge cases or scale nearly as well)
01:17 <tabemann> (it currently doesn't really handle nodes dropping out well right now)
01:17 dogweather joined
01:18 <tabemann> (well, it's okay if a node just dies - but it doesn't handle it as well if some links between nodes are lost but not others)
01:18 eschnett joined
01:24 Arcaelyx_ joined
01:26 <tabemann> (it doesn't scale well either, because it relies on point-to-point links between nodes, so the number of connections scales with n^2
01:28 <Cale> tabemann: Yeah, I highly recommend watching the talks by Duncan Coutts about Cloud Haskell, they're great
01:28 <Cale> https://skillsmatter.com/skillscasts/3523-cloud-haskell -- annoying that you have to log in to watch this one, but at least it's free
01:28 <Cale> https://www.youtube.com/watch?v=1jJ2paFuErM
01:29 <Mrd2> Hey...
01:31 <tabemann> what's up, Mrd2?
01:32 xcmw joined
01:34 fmixing joined
01:34 dogweather joined
01:35 emilypi joined
01:35 <tabemann> why is the Youtube video so quiet
01:36 <monochrom> No, I heard a loud cough right at the beginning :)
01:36 <tabemann> it's not the audio on my machine, since it's fine when I try to use Spotify
01:36 <tabemann> and I set the volume to be the same for Firefox and for Spotify
01:37 sudden joined
01:38 <monochrom> It is not quiet for me. I can hear the speech.
01:38 <tabemann> hmm
01:39 halogenandtoast joined
01:39 <tabemann> I restarted the video, and heard the cough, and little else
01:40 Chenlong joined
01:40 <monochrom> Hmm, after a million restarts you will hear the whole thing :)
01:40 <Chenlong> Woow
01:41 <tabemann> I think my implementation is in some ways more complex API-wise than the core of CH, because I have the concept of "groups", where you can send a single message to any number of listening processes, or you can listen for the death of any number of processes
01:42 <tabemann> at the same time my actor library specifies a very basic wire format for messages; basically one bytestring for a header and one bytestring for a body, with the idea that the header will be decoded and used to determine what type to decode the body with
01:43 <tabemann> that said, it doesn't have typed channels
01:44 <tabemann> it is basically up to the user to do the encoding and decoding of data
01:47 dogweather joined
01:48 patlv joined
01:50 <Chenlong> Why silent
01:51 pipahask joined
01:52 vurtz joined
01:57 <* hackage> butter 0.1.0.3 - Monad Transformer for Asyncronous Message Passing http://hackage.haskell.org/package/butter-0.1.0.3 (mpahrens)
01:58 <* hackage> HNumeric 0.5.0.1 - Haskell Numeric Library with pure functionality, R & MATLAB Syntax. http://hackage.haskell.org/package/HNumeric-0.5.0.1 (edeftg)
02:00 hucksy joined
02:01 night joined
02:03 <* hackage> gdp 0.0.0.2 - Reason about invariants and preconditions with ghosts of departed proofs. http://hackage.haskell.org/package/gdp-0.0.0.2 (mnoonan)
02:04 camsbury joined
02:11 dodong joined
02:11 <* hackage> diagrams-core 1.4.1.1 - Core libraries for diagrams EDSL http://hackage.haskell.org/package/diagrams-core-1.4.1.1 (BrentYorgey)
02:11 ImRatedX joined
02:11 night_ joined
02:18 banc joined
02:22 raylai joined
02:24 dented42 joined
02:27 harfangk joined
02:27 FreeBirdLjj joined
02:28 diwo joined
02:29 chao-tic joined
02:31 woodson joined
02:31 codyrutscher__ joined
02:33 lagothrix joined
02:35 fmixing joined
02:36 justan0theruser joined
02:40 mcspud joined
02:41 theDon joined
02:41 Mrd1 joined
02:41 <Mrd1> Hey....
02:46 acertain joined
02:47 ImRatedX joined
02:47 ImRatedX left
02:50 Mrd1 joined
02:52 zdenal joined
02:54 <systemfault> The dude is basically the IRC version of the Navi fairy from Zelda "Hey...", "listen"
02:55 altjsus joined
03:00 kvda joined
03:02 DasBrain joined
03:02 cybai joined
03:05 dogweather joined
03:06 acertain joined
03:06 pfurla_ joined
03:08 kjak joined
03:10 benjamin-l joined
03:11 jmcarthur joined
03:12 Johannes13 joined
03:13 prg318 joined
03:15 Johannes13 joined
03:17 sim590 joined
03:17 Johannes13 joined
03:18 zdenal joined
03:20 DasBrain joined
03:23 dogweather joined
03:25 theelous3 joined
03:25 jkachmar joined
03:25 DasBrain joined
03:25 kapil___ joined
03:26 DasBrain joined
03:26 davr0s joined
03:27 <* hackage> containers 0.6.0.1 - Assorted concrete container types http://hackage.haskell.org/package/containers-0.6.0.1 (dfeuer)
03:28 earldouglas joined
03:28 ingenthr joined
03:28 tabemann joined
03:28 earldouglas joined
03:28 lassulus_ joined
03:29 enterprisey joined
03:29 <glguy> Oh, updating every package's upper bounds for containers will be fun :)
03:30 DasBrain joined
03:30 <Axman6> Changelog: "Released with GHC 8.6"
03:31 <Axman6> so hopefully it is actually just version bounds
03:31 <glguy> I imagine most packages aren't depending on the deprecated functions that were removed in this release
03:32 <Axman6> oh, urgh, I managed to miss all the other stuff, my eye just saw a new heading and assumes it was the next version >_<
03:33 <Axman6> assumed*
03:33 <tabemann> upper bounds considered harmful
03:34 <glguy> nope
03:34 <Axman6> nah
03:35 <glguy> Perhaps changing existing APIs could be "considered harmful" but upper bounds are just the messanger
03:35 <monochrom> Messenger virtual particles considered harmful. Dark matter FTW.
03:36 <tabemann> the reason I say that is that lower bounds alone only result in a minimum allowable version but lower bounds combined with upper bounds allow a situation where no possible version can be allowed for a given set of packages
03:36 <glguy> that's fine, if packages are incompatible we'll want to know
03:37 <glguy> and it helps to not have libraries become unusable over time just because new versions of things were released
03:37 <monochrom> Absence of upper bounds allows a situation where newbies get weird build errors.
03:38 <tabemann> what might help is to require certain major versions but only have lower bounds on minor versions
03:38 <tabemann> but I don't know if cabal allows that
03:38 <tabemann> because a major version change can be reasonable assumed to be breaking
03:39 <sclv> we have ^>= syntax
03:39 <monochrom> Have you read the PVP?
03:39 <tabemann> PVP?
03:40 <monochrom> Because the PVP already defines version numbers that indicate non-breaking fixes and version numbers that indicate breaking changes.
03:40 <nisstyre> How does one debug a Haskell program that is using an FFI to C, and producing segfaults? Obviously the typical use of valgrind, etc isn't going to work. Is there a better way?
03:40 <nisstyre> (for context, I did not write the program, I'm just trying to fix a bug in it)
03:40 <sclv> tabemann: http://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-build-depends
03:40 <sclv> pvp: https://pvp.haskell.org/
03:41 <nisstyre> Or maybe I can debug it with valgrind, but I'd have to recompile with debug symbols right?
03:41 MoarSpaceFi joined
03:42 <sclv> nisstyre: why won't valgrind work?
03:42 <sclv> i've heard reports it works with haskell code decently
03:42 <nisstyre> sclv: no debug symbols, but I guess I'd do "-optc -g" right ?
03:42 vmandela joined
03:42 sclltr joined
03:43 <nisstyre> I'm just wondering if I'll get a whole bunch of false positives to wade through though
03:43 <sclv> nisstyre: compile with -debug and you get symbols
03:43 <nisstyre> ah ok
03:43 <sclv> these tips are for working with gdb but valgrind works too: https://ghc.haskell.org/trac/ghc/wiki/Debugging/CompiledCode
03:44 <sclv> cf also https://ghc.haskell.org/trac/ghc/ticket/3215 which reports valgrind working
03:44 <nisstyre> sclv: great, that link looks helpful
03:44 zdenal joined
03:45 <tabemann> okay, I'm stupid in wondering whether cabal supports specifying just major version, because it obviously supports ranges of versions
03:46 <tabemann> the PVP was informative though
03:46 fmixing joined
03:47 otto_s_ joined
03:48 khilan joined
03:49 huxing joined
03:51 halogenandtoast joined
03:52 pipahask joined
03:52 scottschmidt1 joined
03:53 keepLearning512 joined
03:53 huxing joined
03:54 diwo joined
03:56 refold joined
03:58 lainon joined
04:01 Linter joined
04:01 jackdk joined
04:03 Destol joined
04:09 boj joined
04:11 unyu joined
04:12 fmixing joined
04:12 camsbury joined
04:15 cetchmoh joined
04:15 greeny_ joined
04:15 chao-tic joined
04:16 LiaoTao joined
04:16 lastmanstanding joined
04:16 quaestor joined
04:17 nnplv joined
04:17 dogweather joined
04:17 woodson joined
04:26 huxing joined
04:27 halogenandtoast joined
04:29 huxing joined
04:30 dogweather joined
04:30 reggie_ joined
04:31 HoloIRCUser1 joined
04:33 codesoup joined
04:33 huxing joined
04:33 slack1256 joined
04:35 huxing joined
04:37 huxing joined
04:39 <cocreature> nisstyre: sclv: fwiw the flag to compile with debug info is called -g not -debug
04:39 <cocreature> and you need a GHC built with DWARF debugging symbols as well for this to work properly
04:40 huxing joined
04:40 <nisstyre> cocreature: thanks, I'm using stack so it shouldn't be an issue to do that
04:41 BartAdv joined
04:42 <cocreature> nisstyre: I don’t think the GHC builds that stack uses by default have DWARF debugging information
04:42 zephyz joined
04:42 Azel joined
04:42 <cocreature> you might also need to disable symbol stripping to make sure the symbols end up in the final binary
04:43 thunderrd joined
04:43 daniel-s joined
04:45 <nisstyre> cocreature: can't I tell stack to use a specific GHC that I've built?
04:45 <cocreature> sure, you can set "system-ghc: true" and then put some GHC in your PATH
04:45 benjamin-l joined
04:46 <cocreature> but if you’re just chasing a segfault, compiling your C code with debugging info is probably sufficient tbh
04:46 <nisstyre> ok, cool, I appreciate the info anyway
04:48 gabcoh joined
04:48 <mniip> DWARF in GHC is terrible anyway
04:49 huxing joined
04:49 <cocreature> it’s definitely not great but it’s still better than nothing :)
04:50 aarvar joined
04:50 Vulfe joined
04:52 huxing_ joined
04:53 p0lyph3m joined
04:53 gabcoh joined
04:54 kvda joined
04:55 howdoi joined
04:55 <mniip> I wouldn't say it's Just either :p
04:58 gabcoh joined
04:59 robstr joined
05:01 zdenal joined
05:01 slomo joined
05:01 slomo joined
05:02 keepLearning512 joined
05:03 language_agnosti joined
05:03 huxing joined
05:04 dogweather joined
05:04 <dminuoso> Im trying to dodge a bullet (MBC) here, but Im not certain whether what Im doing is correct: https://gist.github.com/dminuoso/35b0deb3d3ec88fb2746d3816b219051 is my way of turning some `(R -> IO a) -> IO a` into `(R -> MandyT a) -> MandyT a`
05:04 Ukari joined
05:04 <rotaerk> mniip, would you say it's just Either?
05:05 <mniip> Maybe.
05:05 <rotaerk> lol
05:05 Zialus_PT joined
05:06 <mniip> dminuoso, what is MandyT?
05:06 <dminuoso> mniip: type MandyT = ReaderT Config (ExceptT ServantErr IO)
05:07 <mniip> ah well, there's no nice way to do this
05:07 <mniip> you're lucky it works at all for your transformer
05:08 <dminuoso> mniip: I figured you'd say that. Im guessing if I start adding more things like a StateT into the mix things will brick?
05:08 <mniip> dminuoso, you could do it in two steps
05:08 <cocreature> even ExceptT can be tricky if you don’t pay attention (although your code looks fine)
05:09 <mniip> Monad m => (forall b. (a -> m b) -> m b) -> (a -> ReaderT r m b) -> ReaderT r m b
05:09 <mniip> and then ditto with ExceptT
05:09 <mniip> notice the higher rank of the type
05:10 <mniip> the higher rank isn't necessarily needed for ReaderT, but it is for ExceptT
05:11 <dminuoso> mniip: Im not entirely sure how that relates to my code. Could you give me one further hint?
05:12 <* hackage> glabrous 0.3.6 - A template DSL library http://hackage.haskell.org/package/glabrous-0.3.6 (MichelBoucey)
05:12 <mniip> (I'm going to need a new word for elevation)
05:13 <mniip> dminuoso, "turning some `(R -> IO a) -> IO a` into `(R -> MandyT a) -> MandyT a`"
05:13 <mniip> that can be done in multiple steps: one for each transformer in the stack
05:15 chao-tic joined
05:15 huxing joined
05:18 <* hackage> postgresql-common 0.1.0.0, postgresql-common-persistent 0.1.0.0 (IanDuncan): https://qbin.io/live-skins-isch
05:18 dan_f joined
05:19 huxing_ joined
05:20 <mniip> consider this
05:21 <mniip> @let class Heighten t where heighten :: Monad m => (forall b. (a -> m b) -> m b) -> (a -> t m b) -> t m b
05:21 <lambdabot> Defined.
05:21 <mniip> with an example function:
05:21 <mniip> :t catch undefined
05:21 <lambdabot> Exception e => (e -> IO a) -> IO a
05:21 <mniip> :t heighten $ catch undefined
05:21 <lambdabot> forall k (t :: (* -> *) -> k -> *) a (b :: k). (Exception a, Heighten t) => (a -> t IO b) -> t IO b
05:21 <mniip> :t heighten $ heighten $ catch undefined
05:21 <lambdabot> forall k (t1 :: (* -> *) -> k -> *) (t2 :: (* -> *) -> * -> *) a (b :: k). (Exception a, Heighten t2, Monad (t2 IO), Heighten t1) => (a -> t1 (t2 IO) b) -> t1 (t2 IO) b
05:22 <mniip> you can implement instances:
05:22 <mniip> @let instance Heighten (ReaderT r) where heighten f g = ReaderT (\r -> f (\a -> runReaderT (g a) r))
05:22 <lambdabot> Defined.
05:22 <* hackage> multipool 0.1.0.0, multipool-persistent-postgresql 0.1.0.0, multipool-persistent 0.1.0.0 (IanDuncan): https://qbin.io/helmet-briefs-hjrf
05:22 <mniip> @let instance Heighten (ExceptT e) where heighten f g = ExceptT (f (\a -> runExceptT (g a)))
05:22 <lambdabot> Defined.
05:22 hphuoc25 joined
05:23 <mniip> not saying you should write out this exact class, but splitting your function into two such heighten's is a good idea
05:23 osa1 joined
05:25 pfurla joined
05:25 huxing joined
05:25 danvet joined
05:26 zdenal joined
05:27 acidjnk joined
05:29 gabcoh joined
05:29 Azel joined
05:29 boj joined
05:30 HoloIRCUser1 joined
05:30 <dminuoso> mniip: Okay I can live with this - but ultimately I cant avoid testing whether `heigtening` that callback into a transformer stack breaks some laws/assumptions about the transformer stack, can I?
05:30 trcc joined
05:31 trcc joined
05:31 <geekosaur> right. there's a reason this isn't a standard function somewhere
05:31 <cocreature> there is a reason why unliftio deliberately restricts itself to ReaderT like things :)
05:32 kvda joined
05:32 Azel joined
05:34 <mniip> this is not really unliftio
05:34 <mniip> again, see the higher ranked type
05:35 <mniip> dminuoso, it's simple really
05:35 <mniip> if the function you're calling is of the form \f -> (a >>= f) <* b
05:36 <mniip> hmm maybe not that
05:36 <mniip> \f -> do x <- a; r <- f x; b x; return r
05:36 <dminuoso> mniip: In reality it will be something like: a f *> b f
05:36 <mniip> then it breaks no monad laws
05:37 <dminuoso> Mmm
05:37 guessWHo joined
05:37 <guessWHo> where does this forall keyword comes from and what's it's use ??
05:38 <mniip> otherwise, if f is "invoked" after the function "terminates", then it's going to be off, but predictably so
05:38 vlatkoB joined
05:38 <glguy> guessWHo: It's a type variable quantifier; what it's up to depends on the situation. What are you looking at?
05:38 <cocreature> guessWHo: there are several different uses of forall so you will have to give a bit more context
05:39 <mniip> also hmmm
05:39 <mniip> :t ContT (catch undefined)
05:39 <lambdabot> Exception a => ContT r IO a
05:39 <mniip> !
05:39 saurabhnanda joined
05:39 <dminuoso> mniip: I dont have anything fancy really. At most I might throw an additional MaybeT into the mix.
05:39 jedws joined
05:40 <dminuoso> *perhaps* a WriterT/StateT but Im not certain about that part yet
05:40 <mniip> actually
05:40 <mniip> geekosaur, you turned out to be wrong
05:40 <mniip> heighten = liftCallCC, up to newtype coercions
05:40 <guessWHo> what does it mean in this contex "waitOne :: forall m t . (MonadIO m) => STM.TVar (OQ.PacketStatus t) -> m t"
05:41 <mniip> which I mean, Control.Monad.Trans.Except.liftCallCC and Control.Monad.Trans.Reader.liftCallCC
05:41 <glguy> guessWHo: In that context it's just saying that m and t are introduced at that point in the type signature
05:41 <glguy> In standard Haskell the "forall m t." part is implied
05:41 <glguy> in that type signature in particular
05:42 <mniip> sounds like ScopedTyVars
05:42 <guessWHo> @glguy : it's part of haskell right ? no extension required ?
05:42 <lambdabot> Unknown command, try @list
05:42 <glguy> guessWHo: You need an extension to actually write that forall there
05:42 <guessWHo> @glguy : what's that ?
05:42 <lambdabot> Unknown command, try @list
05:42 <mniip> guessWHo, no it does require an extension. Either ScopedTypeVariables or RankNTypes
05:42 <cocreature> or ExplicitForalls
05:43 <glguy> An extension is required because the "forall" syntax isn't in the Haskell Report
05:43 <guessWHo> mniip : any one of them depending on the context ?
05:43 ozzymcduff joined
05:44 <cocreature> apart from stylistic reasons, the only reason to have the explicit forall in your example would be that ScopedTypeVariables is enabled.
05:44 keepLearning512 joined
05:46 gabcoh joined
05:47 fmixing joined
05:47 Mrd1 joined
05:47 Linter joined
05:48 xtreak joined
05:50 isenmann joined
05:52 gabcoh joined
05:52 pipahask joined
05:53 <dminuoso> :t liftCallCC
05:53 <lambdabot> error: Variable not in scope: liftCallCC
05:55 xtreak_ joined
05:55 Ariakenom joined
05:56 dogweather joined
05:57 gabcoh joined
05:57 ddellacosta joined
05:58 znack joined
06:00 hphuoc25 joined
06:00 <dminuoso> mniip: Okay pretty slick stuff, I suppose this will do nicely indeed. It doesn't actually change my problem, but make withLdap look nicer. :)
06:00 lastmanstanding joined
06:00 <dminuoso> Took me a moment to understand why the rank 2 type was necessary, but it's obvious because things like ExceptT or MaybeT need to change the inner type of the IO
06:01 <dminuoso> (So the continuation must be polymorphic in there)
06:02 gabcoh joined
06:02 justanotheruser joined
06:05 thehivemind5 joined
06:05 gama joined
06:06 <gama> which is better in memory forever functiion call or recursive call of function
06:07 <dminuoso> gama: How do you think forever is implemented?
06:07 FreeBirdLjj joined
06:07 <gama> dminuoso : I don't know
06:08 gabcoh joined
06:08 <dminuoso> gama: https://hackage.haskell.org/package/base-4.11.1.0/docs/src/Control.Monad.html#local-6989586621679327091
06:10 emilypi joined
06:10 tomphp joined
06:10 lortabac_ joined
06:11 Gurkenglas joined
06:11 nickolay_ joined
06:11 <dminuoso> :t heighten . heighten $ catch undefined
06:11 <lambdabot> error:
06:11 <lambdabot> • Couldn't match type ‘(a1 -> t0 m0 b0) -> t0 m0 b0’
06:11 <lambdabot> with ‘forall b1. (a -> m b1) -> m b1’
06:11 <dminuoso> :t heighten $ heighten $ catch undefined
06:11 <lambdabot> forall k (t1 :: (* -> *) -> k -> *) (t2 :: (* -> *) -> * -> *) a (b :: k). (Exception a, Heighten t2, Monad (t2 IO), Heighten t1) => (a -> t1 (t2 IO) b) -> t1 (t2 IO) b
06:13 gabcoh joined
06:17 language_agnosti joined
06:18 gabcoh joined
06:20 zdenal joined
06:21 glittershark joined
06:21 zdenal joined
06:22 davr0s joined
06:23 rish joined
06:23 gabcoh joined
06:23 arkaros joined
06:24 hphuoc25 joined
06:25 hphuoc25 joined
06:25 <[exa]> what kind of lifting is heightening O_O
06:28 plutoniix joined
06:29 gabcoh joined
06:29 anjannath[m] left
06:30 jmnk joined
06:30 <dminuoso> That class should be call Enheightenment
06:31 Boomerang joined
06:32 ogrady joined
06:33 <dminuoso> But Im curious... why does `heighten $ heighten $ catch undefined` type check while `heighten . heighten $ catch undefined` does not
06:33 mariatsji joined
06:33 <dminuoso> :t (.)
06:33 <lambdabot> (b -> c) -> (a -> b) -> a -> c
06:34 <dminuoso> :t heigten (catch undefined)
06:34 <lambdabot> error:
06:34 <lambdabot> • Variable not in scope: heigten :: ((e0 -> IO a0) -> IO a0) -> t
06:34 <lambdabot> • Perhaps you meant ‘heighten’ (line 159)
06:34 <dminuoso> :t heighten (catch undefined)
06:34 <lambdabot> forall k (t :: (* -> *) -> k -> *) a (b :: k). (Exception a, Heighten t) => (a -> t IO b) -> t IO b
06:34 gabcoh joined
06:34 Azel joined
06:34 danso joined
06:34 <Ariakenom> :t ($)
06:34 <lambdabot> (a -> b) -> a -> b
06:35 <Ariakenom> $ is more kind general right?
06:35 <dminuoso> @let data R = R
06:35 <lambdabot> Defined.
06:36 <dminuoso> @let with :: (R -> IO a) -> IO a; with f = f R
06:36 <lambdabot> Defined.
06:36 <dminuoso> :t heighten with
06:36 <lambdabot> forall k (t :: (* -> *) -> k -> *) (b :: k). Heighten t => (R -> t IO b) -> t IO b
06:36 tangmou joined
06:36 <Ariakenom> and you had a kind variable
06:39 gabcoh joined
06:40 Folkol_ joined
06:41 tangmou joined
06:41 HoloIRCUser1 joined
06:42 zds joined
06:43 obi_jan_kenobi__ joined
06:44 danthemyth joined
06:44 arkaros joined
06:44 gabcoh joined
06:44 zds joined
06:47 zds joined
06:49 phenoble joined
06:50 gabcoh joined
06:50 remyhr joined
06:53 zds joined
06:53 ozzymcduff joined
06:53 <zds> @kind Monad
06:53 <lambdabot> (* -> *) -> Constraint
06:54 daniel-s_ joined
06:54 <zds> @unmtl ReaderT
06:54 <lambdabot> Plugin `unmtl' failed with: `ReaderT' is not applied to enough arguments, giving `/\A B C. A -> B C'
06:54 <dminuoso> Where does that kind polymorphism come from in there?
06:55 gabcoh joined
06:55 <zds> \quit
06:55 hamishmack joined
06:56 jhrcek joined
06:58 halogena1dtoast joined
07:00 gabcoh joined
07:01 <* hackage> hw-dsv 0.2.1 - Unbelievably fast streaming DSV file parser http://hackage.haskell.org/package/hw-dsv-0.2.1 (GeorgeWilson)
07:02 diwo joined
07:02 LiaoTao left
07:02 cur8or joined
07:02 encod3 joined
07:05 gabcoh joined
07:06 Ariakenom joined
07:07 slaznick joined
07:07 huxing joined
07:08 kadal joined
07:09 <kadal> test
07:09 <kadal> just wondered wether this channel still alive :D
07:10 kadal left
07:10 RegEchse joined
07:11 gabcoh joined
07:12 <Ariakenom> acc
07:14 <dminuoso> Ariakenom: Can you elaborate on what you were trying to say regarding the kind variable?
07:15 <Ariakenom> I think $ has more general kinds than .
07:15 <dminuoso> Huh?
07:16 gabcoh joined
07:16 <dminuoso> Ariakenom: oh this is about levity polymorphism?
07:16 <Ariakenom> yes
07:17 raichoo joined
07:17 <dminuoso> :t ($)
07:17 <lambdabot> (a -> b) -> a -> b
07:17 <dminuoso> Bargh what is this magic
07:17 <dminuoso> Shouldnt this be: ($) :: forall (r :: RuntimeRep) (a :: *) (b :: TYPE r). (a -> b) -> a -> b
07:18 chele joined
07:18 <Ariakenom> I think there's some kind of hiding shenanigans
07:18 <dminuoso> GHC lying to me :(
07:18 <dminuoso> https://ghc.haskell.org/trac/ghc/ticket/11549
07:18 <dminuoso> So I guess I have to wait a year :(
07:19 ammazza joined
07:20 Scip__ joined
07:20 earthy joined
07:21 gabcoh joined
07:23 <Ariakenom> dminuoso: for what? what's the problem?
07:23 halogenandtoast joined
07:24 andyhoang joined
07:24 arkaros joined
07:26 Mrd1 joined
07:26 gabcoh joined
07:27 cur8or joined
07:27 ThomasLocke joined
07:29 reactormonk joined
07:29 dpyro joined
07:29 kuribas joined
07:32 gabcoh joined
07:32 dddddd joined
07:34 __bo joined
07:35 lainon joined
07:35 connrs joined
07:36 fanta7531 joined
07:37 gabcoh joined
07:39 ozzymcduff joined
07:40 ozzymcduff joined
07:40 <mniip> dminuoso, lambdabot is too old
07:41 tangmou joined
07:41 <mniip> % :i ($)
07:41 <yahb> mniip: ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b -- Defined in `GHC.Base'; infixr 0 $
07:42 gabcoh joined
07:43 fishythefish joined
07:44 tysonzero joined
07:45 <tysonzero> Does anyone how to make backend specific filters in persistent that are prefix and not infix, e.g postgis `ST_Intersects(a, b)`?
07:45 dogweather joined
07:45 tangmou joined
07:46 fishythe_ joined
07:47 SenasOzys joined
07:47 _bo joined
07:47 gabcoh joined
07:49 <dminuoso> mniip: Ah actually that's because it uses :i rather than :t I guess?
07:49 <mniip> true
07:50 <mniip> can't seem to make ghc output the runtimereps in :t
07:51 language_agnosti joined
07:52 zdenal joined
07:52 mreh joined
07:53 gabcoh joined
07:53 <dminuoso> mniip: yeah check the issue I just linked :s
07:56 hphuoc25 joined
07:58 gabcoh joined
08:00 whaletechno joined
08:01 <mniip> hmm
08:01 <mniip> I guess type families aren't so introspective
08:02 jekor joined
08:02 tomphp joined
08:03 zdenal_ joined
08:03 <mniip> you can't have an (f x) pattern match in a type family without knowing the kind of x beforehand
08:03 gabcoh joined
08:04 nickolay_ joined
08:04 tangmou joined
08:04 <mniip> or maybe you can
08:05 keepLearning512 joined
08:07 oo_miguel joined
08:08 keepLearning512 joined
08:08 JanBessai joined
08:08 gabcoh joined
08:09 yeevy joined
08:09 huxing joined
08:09 <halogenandtoast> Howdy #haskell, have a question. Considering making a series of HaskellCasts to help beginners get started with Haskell. Trying to come up with a good list of starter videos to make and I was wondering if anyone here had any insight on which topics might be good to cover first.
08:10 lastmanstanding joined
08:10 phenoble joined
08:10 <halogenandtoast> I feel like the target audience is people with little to no Haskell experience so as to make the community more acessible
08:10 emilypi joined
08:10 <halogenandtoast> s/acessible/accessible/
08:11 WhatisRT joined
08:13 <halogenandtoast> In no particular order, here are some ideas I had: https://gist.github.com/halogenandtoast/1d0c716d751504bd47f9d5cd4813f3cc
08:14 gabcoh joined
08:14 <Cale> Find stuff where you feel that what exists doesn't do a great job of introducing it.
08:15 nano__ joined
08:15 <Cale> There's probably a lot of that
08:16 dpower joined
08:16 <halogenandtoast> Yeah, I feel like that's most things, but I haven't put my finger on exactly why. My learning style might be different than others though
08:17 <halogenandtoast> I frequently see the comments that we need beginner friendly introductions to many things
08:18 <[exa]> halogenandtoast: gloss and/or juicypixels
08:18 <[exa]> not that it would be very advanced but beginners love visualizations
08:18 Linter joined
08:18 dogweather joined
08:19 <halogenandtoast> Yeah I think things like that, at the very least are fun and show different areas of what can be done
08:19 curious_corn joined
08:19 <halogenandtoast> I'm adding those to the list, thanks [exa]
08:19 <kuribas> there's Ihaskell, a IJupiter notebook for haskell.
08:19 gabcoh joined
08:19 <kuribas> I believe it supports diagrams as well.
08:20 <Ariakenom> halogenandtoast: That's a long enough list to include STM
08:20 thehivemind5 joined
08:20 thc202 joined
08:20 <[exa]> halogenandtoast: I also kindof believe that fixpoints should have much more coverage/practice (esp. given there's mdo in every other FRP tutorial)
08:20 <halogenandtoast> Ariakenom: yeah, that means I'll have to learn STM as well.
08:21 <Cale> There's very little which could be said about monads which hasn't already been said elsewhere, and regardless, the best introduction to monads is just lots of introductions to other things anyway.
08:21 <[exa]> halogenandtoast: ContT might be interesting (it goes in similar direction)
08:22 <halogenandtoast> Cale: that list is just a high level overview of some thoughts, Monads might just be many videos covering different monads
08:24 <halogenandtoast> Thanks for the insight everyone, now to actually make some content.
08:24 gabcoh joined
08:24 <u-ou> what are you going to start with?
08:25 <halogenandtoast> u-ou: to be honest I'm still not sure, I was going to stare and think about my list for the next hour or so until I decided what was best
08:26 <halogenandtoast> to be honest I always felt like a good introduction to Haskell would start with type classes
08:26 dogweather joined
08:26 amar joined
08:26 <[exa]> halogenandtoast: good introduction to typeclasses should start with prolog
08:26 <Cale> halogenandtoast: Are you trying to be comprehensive, or cover things that people might not have seen elsewhere?
08:26 <* [exa]> hides
08:26 <quicksilver> different things work for different audiences.
08:27 <quicksilver> a good presentation starts with something which hooks your audience in
08:27 <u-ou> what have typeclasses to do with prolog?
08:27 <quicksilver> identify your audience and then decide how to grab their attention
08:27 <halogenandtoast> Cale: my goal is really to cover a wide range of topics so people could pick and choose, but at least let the first 10 or so videos maybe be more of a flow than the following ones.
08:28 <quicksilver> one audience might be hooked in by the promise of a programming language which has category theory underpinnings (that is a small group); another audience might be hooked in by the promise of a language which lets you produce complex graphics with only a few lines of code, ... etc
08:28 <dminuoso> u-ou: you can think of typeclasses with constraints as a simplified version of prolog
08:29 gabcoh joined
08:30 <halogenandtoast> quicksilver: the audience will probably have to go through the great filter (aka me) and since I don't know too much category theory, that filter is going to be present in the content I make.
08:30 <halogenandtoast> I've read the first chapter in a few books and that's about it.
08:30 <u-ou> what I would like is guides on writing larger programs, what to use when and why,
08:30 <halogenandtoast> category arrow isomorphism, these are words
08:31 xtreak joined
08:31 arkaros joined
08:32 zero_byte joined
08:33 <dstolfa> halogenandtoast: if you're going to teach some more advanced cat theory, please do consider including HoTT as well, as types can be interpreted as infinity-groupoids so it might help make a connection for other people
08:33 ozzymcduff joined
08:34 <halogenandtoast> dstolfa: I'll add it to my personal reading list. Category theory is probably a long ways out if ever.
08:35 gabcoh joined
08:35 dpower joined
08:35 <halogenandtoast> I haven't considered Category theory pivotal in my general usage of Haskell
08:35 <halogenandtoast> Parts of it make things more interesting and sometimes help unravel the underlying reasons for things.
08:35 davr0s joined
08:35 <halogenandtoast> But I often don't need to understand them to make things work.
08:36 <dminuoso> u-ou: A classic example might be, where if you have `instance (Eq a) => Eq [a]` that's pretty much the equivalent of prolog `Eq([A]) :- Eq(A)`
08:36 <halogenandtoast> So my abilities to explain them are rather limited.
08:36 <dminuoso> Heck I wonder whether Edward even named (:-) as a hint to prolog
08:37 <halogenandtoast> dminuoso: whcih ekmett thing has (:-)
08:37 <dminuoso> halogenandtoast: https://hackage.haskell.org/package/constraints-0.10/docs/Data-Constraint.html
08:37 nadare joined
08:38 <dstolfa> halogenandtoast: i tend to agree with you that you don't have to know category theory in order to work with haskell
08:38 <dstolfa> halogenandtoast: i wonder, if this is for the beginner, if it might make sense to just present them as "effects" rather than monads and try to make a point that they can be thought of as an interface for effects
08:39 zakora joined
08:40 gabcoh joined
08:41 <dstolfa> dminuoso: (:-) looks like a smiley to be honest
08:41 <dminuoso> dstolfa: Haha, well without the parens of course. :)
08:41 <halogenandtoast> dstolfa: I'm sure I'd include some of those words to be honest my simplest perception of monad is to first just think of it as a typeclass with one important method (>>=) and then explain what the intent of the method is
08:41 <halogenandtoast> then show how that intent works with many different monads
08:41 <halogenandtoast> then work back to the monadic laws
08:41 <dstolfa> halogenandtoast: hmm, that might be good too yeah
08:42 <dminuoso> halogenandtoast: the "intent of the method"?
08:42 <halogenandtoast> to sequence operations with side effects
08:42 <dminuoso> halogenandtoast: Im curious, what is the "intent" of (>>=) other than its type and laws?
08:42 <dstolfa> halogenandtoast: the problem is that the more of category theory you know, the "simplest" explanation of a monad is with, well, primitives of category theory
08:42 <dstolfa> that you've built up, that is
08:42 <halogenandtoast> I mean a monad is just a monoid in the category of endofunctors
08:43 <dstolfa> halogenandtoast: monoidal category
08:43 <halogenandtoast> I forget if that phrase is forbidden here
08:43 <* dstolfa> flies away
08:43 <dminuoso> halogenandtoast: A monad is just an abstract lawful interface.
08:43 <dminuoso> That's the perspective Ive burned into my mind.
08:43 <dstolfa> dminuoso: it's just an adjunction with 2 natural transformations
08:43 <halogenandtoast> dminuoso: yes, but that definition is too abstract for beginners
08:43 Vulfe joined
08:43 <halogenandtoast> abstraction is often the enemy of understanding
08:44 <dminuoso> halogenandtoast: and sequencing side-effects is just a weird of telling a beginner "look you can do imperative things"
08:44 Azel joined
08:44 <dstolfa> halogenandtoast: i disagree. if you want to distill the essence of something and understand what its properties are in the general sense, you have to think in the abstract
08:44 <halogenandtoast> dstolfa: I think you have to works towards the abstract
08:44 <halogenandtoast> once you get there you understand
08:44 <dminuoso> halogenandtoast: any attempt to explain monad in concrete terms is bound to fail because people will cling to examples instead of zooming out and seeing the pattern
08:45 <halogenandtoast> but often starting with the abstract makes things too translucent
08:45 <dminuoso> basically you have to bombard them with 4 wildly different instances and show what they have in common
08:45 <dstolfa> halogenandtoast: sure, but sometimes you have no good intuition for what the "abstract" is, you just have to take it with the perspective of definitions that were given
08:45 gabcoh joined
08:46 <dstolfa> does it make sense to implement a monad in C++ and show them that first?
08:46 <halogenandtoast> dstolfa: no
08:46 <dstolfa> just to show the programming pattern
08:46 <dminuoso> halogenandtoast: I believe one of the cleaner routes of talk about Monad is to talk about some simpler abstract patterns first like Monoid
08:46 <halogenandtoast> to be honest, and I'm probably going to get flack for this
08:46 <halogenandtoast> but I don't see the utility of monads without the do syntax
08:46 <halogenandtoast> I mean I'll still use them without it
08:46 <dminuoso> halogenandtoast: and therein lies the problem already.
08:47 <halogenandtoast> but having a construct in the language helps a lot
08:47 <dminuoso> To me its things like >=> that truly capture the notion of monads :)
08:47 <dminuoso> just like how (.) can be seen as the most fundamental thing about functions
08:48 <* dstolfa> learned monads purely from mathematics, not haskell and therefore sees the do syntax as just syntactic sugar for a more concrete version of a join
08:48 <* dysfun> just reads do notation as 'and then'
08:49 <halogenandtoast> So for some back history here dminuoso and dstolfa I'm a recovering Ruby developer and before that PHP with some C, Java, and QBasic mixed in their somewhere.
08:49 thehivemind5 joined
08:49 <halogenandtoast> *there
08:50 <halogenandtoast> And along the way I found discussions of Category theory and Monads to be impenetrable, making Haskell hard for me to learn
08:50 <dminuoso> halogenandtoast: Monad is an abstract interface, dicated by `return` and `>>=`. These functions have no real meaning other than given by the monad laws.
08:50 <dminuoso> halogenandtoast: Monoid is an abstract interface, dicated by `mempty` and `<>`. These functions have no real meaning other than given by the monoid laws
08:50 whaletechno joined
08:50 <halogenandtoast> At some point I decided not to care that I didn't know what a Monad was and just started writing stuff
08:50 gabcoh joined
08:51 <dminuoso> Functor is an abstract interface, dicated by `fmap`. That function has no real meaning other than given by the functor laws.
08:51 <dminuoso> And so forth
08:51 <dysfun> halogenandtoast: best way
08:51 <dstolfa> dminuoso: remind me, is "mempty" the identity case for the operator <>?
08:51 <* dstolfa> always forgets the order in haskell
08:51 <cocreature> ah another day of people debating monad tutorials, I was starting to miss it
08:51 <dysfun> obviously once you learn monads, you will become incapable of explaining them in a way that can be understood
08:51 <earthy> dstolfa: it is.
08:51 <dstolfa> earthy: thanks
08:51 <earthy> dstolfa: a <> mempty == a
08:51 <dysfun> cocreature: what is the comonad instance of burrito, anyway?
08:52 <dstolfa> earthy: righto, thanks
08:52 <halogenandtoast> cocreature: in all fairness, I haven't actually said I'd touch Monads :p it was just on my list of topics to make a HaskellCast about
08:52 <halogenandtoast> but that's a possible list, not a definite list
08:52 <dstolfa> dysfun: there are many comonads of burritos!
08:52 <dysfun> of course there are
08:53 <halogenandtoast> but it's one of those painful things that if you want to make content to help people learn Haskell, asking them to go somewhere else for some of the content feels weird
08:53 <* dysfun> will be back later, seems to be buried under a stack of burritos
08:53 <cocreature> halogenandtoast: you might want to choose a different name, given that there is already a (not super active but also not dead afaik) podcast called Haskell Cast
08:53 perspectival joined
08:53 slomo joined
08:53 slomo joined
08:53 <* hackage> HsYAML 0.1.1.1 - Pure Haskell YAML 1.2 parser http://hackage.haskell.org/package/HsYAML-0.1.1.1 (HerbertValerioRiedel)
08:53 <halogenandtoast> cocreature: too late, I bought the haskellcasts.com domain
08:53 <dminuoso> halogenandtoast: I dont know about that. A lot of hooks have phrases like "Should the reader not be comfortable with subject X I highly recommend reading ABC"
08:54 <cocreature> you can still buy another domain :)
08:54 <halogenandtoast> dstolfa: I read a whitepaper that actually talked about whether or not burritos were truly monadic
08:54 <dstolfa> dminuoso: i think the problem stems from the fact that people don't want to read, as other languages don't require them to read books or papers on the background maths
08:54 <dstolfa> halogenandtoast: what does something being "monadic" mean?
08:54 <halogenandtoast> do burritos follow the monadic laws
08:54 <halogenandtoast> I'll see if I can find it
08:54 <dysfun> it means they're not understandable
08:54 xtreak joined
08:55 plutoniix joined
08:55 <dstolfa> as in
08:55 <dstolfa> burrito as the monad?
08:55 <halogenandtoast> http://emorehouse.web.wesleyan.edu/silliness/burrito_monads.pdf
08:55 <dminuoso> dstolfa: I firmly believe that the refusal to actually *read* (whether its books or documentation) on things they use is one of the reasons webdev is so filled with shitty software.
08:55 <dysfun> and i certainly didn't understand monads after reading about how they were burritos
08:55 <dstolfa> a burrito of a burrito of a burrito can be reduced to a burrito of a burrito by removing the inner or the outer burrito, which can be reduced to a burrito by removing the final one?
08:55 <dstolfa> and a burrito can be made a burrito of a burrito by wrapping the inside or the outside into a burrito of a burrito and then reduced back to a burrito?
08:55 <halogenandtoast> for reference this paper doesn't aim to state that monads are like burritos, but whether or not burritos are monads
08:56 <dminuoso> tortilla endofunctor.
08:56 <dstolfa> i mean, assuming you can insert a tortilla under a tortilla, sure
08:56 <dstolfa> they do follow monadic laws
08:56 gabcoh joined
08:56 <dysfun> they have you unwrapping the first tortilla to put it in another
08:56 <halogenandtoast> The burrito monad is in fact strong.
08:57 <dstolfa> dysfun: but then it's not monadic
08:57 <dstolfa> dysfun: the universal property says that you don't get to unwrap first and then wrap twice, it says that you get to wrap the inner-most part
08:57 <dysfun> dstolfa: you don't have to tell me, it's almost like analogies break apart
08:57 <dstolfa> which assumes the ability to insert a tortilla under a tortilla
08:57 <dminuoso> When people say `X is strong with respect to XYZ` do they mean that X is a monad on a monoidal category equipped with a bifunctor XYZ, which has the required natural transformation?
08:57 <halogenandtoast> You might not have read the part that says
08:57 <halogenandtoast> Note that the tortilla endofunctor is, in general, not monoidal.
08:58 <dstolfa> dminuoso: in my experience, "strong" means different things to different people
08:59 <dysfun> "strong" immediately makes me think of strong profunctors
08:59 <dstolfa> dminuoso: the only modified i can think of in category theory that means the same to everyone is small and locally small
08:59 <dminuoso> dysfun: dont they all talk about tensorial strength?
08:59 <dstolfa> modifier*
08:59 <dysfun> dminuoso: ?
08:59 <dstolfa> and "co"
08:59 <dstolfa> as in, cocone, coalgebra, comonad, ...
09:00 <dminuoso> Oh wait. *functors* can have tensorial strength
09:00 <halogenandtoast> cocaine?
09:00 theelous3_ joined
09:00 hphuoc25 joined
09:00 <dysfun> first you must implement caine
09:00 <halogenandtoast> Already done data Caine = MichaelCaine
09:01 <dstolfa> hang on, if a burrito is a monad of category food, what is its dual?
09:01 <dminuoso> A coburrito?
09:01 <dstolfa> surely we'd have to talk about food wrapping tortillas
09:01 gabcoh joined
09:01 <dminuoso> @let import Control.Comonad
09:01 <lambdabot> Defined.
09:01 logzet joined
09:01 xtreak joined
09:01 lastmanstanding joined
09:02 <dstolfa> we need an opposite category of food
09:02 <dstolfa> how does that work
09:02 <dysfun> it's easy, tortillas just cause localised disturbances at the quantum level and the new tortilla teleports through the outer one
09:02 <halogenandtoast> dstolfa: you have to watch the Taco Town skit
09:02 <halogenandtoast> to see the dual
09:02 <dminuoso> dysfun: well we need an opposite category Stf^Op
09:02 Mrd1 joined
09:02 <dminuoso> Is that a category of stuff you throw up9?
09:02 <halogenandtoast> I believe it's either a pizza, crepe, or blueberry pancake
09:02 <dstolfa> can we think about it in the subcategory of mexican food?
09:03 merijn joined
09:03 <dysfun> dminuoso: hey if i can make you buy cquantum disturbances, i think we can do the opposite category
09:04 <halogenandtoast> Okay, need to stop computering so I can plan some videos no one is going to watch, thanks all for the feedback/insight.
09:04 <dysfun> halogenandtoast: you can use the quantum teleportation bit if you want ;)
09:04 <* dysfun> looks forward to seeing that animation
09:04 YongJoon1 joined
09:05 <dstolfa> halogenandtoast: can you please explain monads with burritos
09:05 andreabe_ joined
09:06 <dysfun> dstolfa: phil freeman explained profunctors with burritos
09:06 <dstolfa> dysfun: link please
09:06 gabcoh joined
09:06 andreabedini joined
09:06 <dstolfa> can we please explain everything in category theory with burritos?
09:06 <dysfun> dstolfa: it's a long one i'm afraid https://www.youtube.com/watch?v=OJtGECfksds
09:07 bahamas joined
09:08 <jesyspa> Has a Haskell+cooking combined workshop on monads and burritos been done yet?
09:08 <dminuoso> Okay thats it.. hunger preventing me from working.
09:08 <u-ou> what happens when you cook a monad?
09:09 <dminuoso> There is no natural transformation cook
09:09 <dstolfa> jesyspa: we should be able to explain much of the HoTT with burritos as well, in terms of different ways to wrap a tortilla around food and still form a burrito
09:09 <dminuoso> Although wait..
09:09 <dminuoso> Inside the category Stf there should be an endofunctor `cook`
09:10 thehivemind5 joined
09:10 <dminuoso> At the very least it should be able to act on Füd
09:10 <bahamas> hello. I'm seeing this error when running `stack build` https://lpaste.net/8878672555976687616 even though I have a "library" section in my cabal file. the section contains the stanza "exposed-modules: Hello"
09:10 <bahamas> s/error/warning/
09:11 <dminuoso> bahamas: can you show your cabal file?
09:11 fendor_ joined
09:11 <dysfun> u-ou: phil used cooking to explain profunctors
09:12 gabcoh joined
09:12 <u-ou> can you use functors to explain profunctors?
09:12 <bahamas> dminuoso: here it is https://lpaste.net/2207975560829730816
09:12 <u-ou> I know what the former is, but not the latter
09:13 sword865 joined
09:13 <cocreature> bahamas: you forgot to depend on your library in your executable
09:13 <dysfun> u-ou: a profunctor is an extension of functor
09:13 <dstolfa> jesyspa: and in fact, if we think of universes and burrito fillings, where each universe adds something else, we can describe the pi type as a function of a burrito B depending on some filling x, so we can have PI (x : A) . B(x)
09:13 <jesyspa> u-ou: I got the feeling profunctors are "Things that are like Hom, but more general".
09:13 <cocreature> bahamas: also I would recommend to use different src dirs for the library and the executable
09:13 <dstolfa> s/universes and/universes as/
09:14 <jesyspa> dstolfa: Personally, I prefer my burritos to be sum types; having all fillings at once is just a little too much :)
09:14 <bahamas> cocreature: I'm following the haskell book and it didn't mention depending on the library. at least not yet
09:14 <bahamas> maybe that was intentional
09:14 <dysfun> u-ou: it's essentially a mashup between functors and contravariant functors
09:14 <dstolfa> jesyspa: see, we can keep going
09:14 <dstolfa> jesyspa: in fact, i think we can get as far as to make the analogy from HoTT to category theory with burritos alone
09:14 <cocreature> bahamas: I don’t know about the haskell book but if you are using things in your library (which you are apparently since you are probably importing Hello in your executable) then you need the dependency
09:14 <dysfun> u-ou: if you have a couple of hours, the link i pasted a few mins ago is very good
09:15 fishythefish joined
09:15 <cocreature> if you don’t use things in your library you don’t need the dependency
09:15 <u-ou> ahh
09:15 <bahamas> cocreature: that makes sense. thanks!
09:15 <dminuoso> bahamas: Also dont be afraid if for some reason you are straying off the book a bit. :)
09:15 <dstolfa> someone should make a subconference of lambdaconf or something where the entire purpose is to prepare talks that explain various abstract topics in maths with burritos
09:15 <cocreature> bahamas: if you had different src-dirs you would get an error about a missing module rather than the warning you are seeing right now
09:15 reactormonk joined
09:16 keepLearning512 joined
09:16 oish joined
09:17 gabcoh joined
09:17 <jesyspa> dstolfa: The link to HoTT is obvious! If you have two burritos and they are observably the same, you don't *want* to know what the difference in filling is.
09:18 sakalli_ joined
09:18 <dstolfa> jesyspa: nor do you care how they're wrapped as long as it doesn't fall apart!
09:18 tsaka__ joined
09:18 <dminuoso> Neat, Weirich has been announced for the Haskell eXchange in October :)
09:19 pranz3 joined
09:20 <jesyspa> dstolfa: And since they're all wrapped up, if you don't explicitly track which burrito is whose, you can't tell!
09:20 <dysfun> dminuoso: i predict talk about dependent types
09:20 <dminuoso> dysfun: I hope so. :)
09:21 lykrysh joined
09:21 <dstolfa> jesyspa: and similarly, if we have different ways to fold a burrito, you can think of the "thinkinf of how to fold a burrito" in the same sense, and you can think about thinking about folding a burrito, think about thinking about thinking about...., in fact, it forms an infinity-groupoid
09:22 <dstolfa> and you can talk about equivalence there
09:22 <dstolfa> in each one
09:22 gabcoh joined
09:23 thehivem_ joined
09:23 catsup joined
09:23 cloudhead joined
09:24 <jesyspa> dstolfa: Hmm, yes, I think that would be the infinity-groupoid of Burrito-origami?
09:24 curious_corn joined
09:24 <dstolfa> jesyspa: it does sound so
09:25 catsup joined
09:27 gabcoh joined
09:29 skeuomorf joined
09:32 bas080 joined
09:32 Mutter joined
09:33 gabcoh joined
09:33 Mrd1 joined
09:33 psychicist__ joined
09:35 jfredett_ joined
09:36 emilypi joined
09:38 gabcoh joined
09:39 rprije joined
09:42 glittershark joined
09:42 curious_corn joined
09:43 gabcoh joined
09:43 mreh joined
09:48 gabcoh joined
09:52 jeltsch joined
09:52 hphuoc25 joined
09:54 gabcoh joined
09:56 fmixing joined
09:59 keepLearning512 joined
09:59 gabcoh joined
09:59 thehivemind5 joined
10:00 comerijn joined
10:00 sheyll joined
10:00 wonko7 joined
10:02 thehivem_ joined
10:03 Mutter joined
10:04 jekor left
10:04 gabcoh joined
10:05 <* hackage> jvm-binary 0.1.0 - A library for reading Java class-files http://hackage.haskell.org/package/jvm-binary-0.1.0 (kalhauge)
10:06 encod3 joined
10:08 simukis joined
10:09 gabcoh joined
10:10 keepLearning512 joined
10:11 thehivemind5 joined
10:11 WhatisRT joined
10:11 Sampuka joined
10:12 keepLearning512 joined
10:13 boj joined
10:13 cloudhead joined
10:14 gabcoh joined
10:15 hphuoc25 joined
10:15 booglewoogle joined
10:17 booglewoogle left
10:18 Mutter joined
10:18 andreabedini joined
10:18 keepLearning512 joined
10:19 pally joined
10:19 <pally> > data PairOfThings a = Pair a a deriving (Show)
10:19 <lambdabot> <hint>:1:1: error: parse error on input ‘data’
10:20 bhiliyam joined
10:20 gabcoh joined
10:20 KeyJoo joined
10:20 bwe joined
10:22 <quicksilver> @let data PairOfThings a = Pair a a deriving (Show)
10:22 <lambdabot> Defined.
10:23 keepLearning512 joined
10:23 bahamas joined
10:24 Folkol_ joined
10:25 Tops2 joined
10:25 huxing joined
10:25 gabcoh joined
10:27 <pally> hi quicksilver
10:27 <mreh> is a sort that will produce results before all values have been compared?
10:27 huxing joined
10:27 <mreh> I suppose I could just filter for the minimum
10:28 <pally> > somePair = Pair 1 "a"
10:28 <lambdabot> <hint>:1:10: error:
10:28 <lambdabot> parse error on input ‘=’
10:28 <lambdabot> Perhaps you need a 'let' in a 'do' block?
10:29 <pally> > @let somePair = Pair 1 "a"
10:29 <lambdabot> <hint>:1:1: error: parse error on input ‘@’
10:29 <pally> > let somePair = Pair 1 "a"
10:29 <lambdabot> <no location info>: error:
10:29 <lambdabot> not an expression: ‘let somePair = Pair 1 "a"’
10:29 <reactormonk> @let somePair = Pair 1 "a"
10:29 <lambdabot> .L.hs:175:17: error:
10:29 <lambdabot> • No instance for (Num [Char]) arising from the literal ‘1’
10:29 <lambdabot> • In the first argument of ‘Pair’, namely ‘1’
10:30 PLPD-Bot joined
10:30 <pally> reactormonk, yes, I specifically want to discuss this emiited error msg from the intention type parameter mismatch
10:30 gabcoh joined
10:30 <pally> type* mismatch
10:31 <pally> errr... intentional mismatch, I mean.
10:32 <cocreature> mreh: the sort function in Data.List will produce results lazily but if you just care about the minimum, using "minimum" directly will probably be more performant
10:32 <reactormonk> pally, your question?
10:32 <pally> reactormonk why did the compiling say "No instance for (Num [Char]) arising from the literal ?1?" instead of saying something about the type mismatch?
10:33 <reactormonk> > 1
10:33 <pally> compiler*
10:33 <lambdabot> 1
10:33 <mreh> cocreature, I think what I need is not really a strict sort
10:33 <reactormonk> pally, ghci does a few weird things along the way.
10:33 <cocreature> mreh: what do you need then?
10:33 <reactormonk> > :t 1
10:33 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
10:33 <reactormonk> @t 1
10:33 <lambdabot> Maybe you meant: tell thank you thanks thesaurus thx tic-tac-toe ticker time todo todo-add todo-delete type v @ ? .
10:33 keepLearning512 joined
10:33 Mutter joined
10:33 <reactormonk> @type 1
10:33 <lambdabot> Num p => p
10:33 thehivemind5 joined
10:34 <reactormonk> @let somePair = Pair (1 :: Int) "a"
10:34 <lambdabot> .L.hs:175:28: error:
10:34 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘[Char]’
10:34 <lambdabot> • In the second argument of ‘Pair’, namely ‘"a"’
10:34 <mreh> cocreature, minimum
10:34 <reactormonk> pally, that's what you were looking for?
10:34 <cocreature> mreh: then just use the "minimum" function :)
10:34 arkaros joined
10:34 tangmou joined
10:35 <mreh> cocreature, if I know what the absolute minimum could be, I could write my own that will terminate early
10:35 <pally> reactormonk, yea that's something I'd expect the compiler would say when there is a type mismatch
10:35 <mreh> rather than compare every element
10:35 gabcoh joined
10:36 <reactormonk> pally, well, there wasn't. The first one was Num p => p, not Int. So it expected the second one also to have a Num instance, which it didn't. So it told you there was no Num instance.
10:36 tomphp joined
10:36 <reactormonk> @let somePair = Pair "a" 1
10:36 <lambdabot> .L.hs:175:21: error:
10:36 <lambdabot> • No instance for (Num [Char]) arising from the literal ‘1’
10:36 <lambdabot> • In the second argument of ‘Pair’, namely ‘1’
10:37 <reactormonk> Because it would be a valid solution for the problem you gave the typechecker. Putting in `String` for `a` would not be a valid solution in any way. However, Num a => a is a vaild solution - except `String` doesn't have a Num instance.
10:37 amar_ joined
10:37 rihardsk[m] left
10:38 buzo joined
10:39 huxing joined
10:39 <cocreature> mreh: sure if that’s something that applies to your application, go for it!
10:39 tomphp joined
10:41 gabcoh joined
10:41 vurtz joined
10:43 reactormonk joined
10:45 danthemyth joined
10:46 gabcoh joined
10:47 acidjnk joined
10:47 <pally> reactormonk is it true to say that from ghci's pov the literal 1 in `Pair 1 "a"` doesn't have a recognized type, and that all it knows is that it is a Num instance?
10:48 Linter joined
10:48 youtmon joined
10:48 nyberg joined
10:50 <Ariakenom> :t 1
10:50 <lambdabot> Num p => p
10:50 HarveyPwca joined
10:51 alexteves joined
10:51 <pally> ah... nvm. I see
10:51 gabcoh joined
10:52 <pally> actually, p at this point is still polymorphic ("generic") right?
10:52 <Ariakenom> pally: yup. your statement sounds ok
10:52 <Ariakenom> The 1 has type p. And that type p has a Num isntance.
10:52 louispan joined
10:53 zdenal joined
10:53 <pally> thanks my #haskell friends.
10:54 keepLearning512 joined
10:54 jao joined
10:54 <quicksilver> "the 1 can take *any* type p, but will require that type p to have a Num instance"
10:54 skeuomorf joined
10:56 curious_corn joined
10:57 gabcoh joined
10:57 ijks joined
10:57 mreh joined
10:58 fujiy joined
10:58 tsaka__ joined
10:59 cur8or joined
10:59 reactormonk joined
11:01 <pally> in Haskell parlance I hear "<something> to have a Blah instance" alot. vs in OOP parlance, we'd instead hear something "<something> to be an instance of a class"
11:02 <pally> just wanted to throw that out there as well.
11:02 gabcoh joined
11:03 <reactormonk> pally, yeah, there's a reason for that distinction. The main difference is where the function code is stored - inside the object, or besides it.
11:04 hphuoc25 joined
11:05 tomphp joined
11:07 gabcoh joined
11:07 <cocreature> pally: haskell’s type classes are more like interfaces in oop languages
11:08 WhatisRT joined
11:09 <Ariakenom> Can you have maxBound as an interface constant in oop-lang?
11:10 <* hackage> derive 2.6.4 - A program and library to derive instances for data types http://hackage.haskell.org/package/derive-2.6.4 (ip1981)
11:10 deepfire` joined
11:11 <pally> Ariakenom, not that I know (at least not in Java)
11:11 <Ariakenom> > maxBound :: Int
11:11 <lambdabot> 9223372036854775807
11:11 thehivemind5 joined
11:12 keepLearning512 joined
11:12 gabcoh joined
11:13 <Ariakenom> :t \f g -> all (\x -> f x == g x) [minBound..maxBound]
11:13 <lambdabot> (Enum t, Bounded t, Eq a) => (t -> a) -> (t -> a) -> Bool
11:13 louispan joined
11:13 ericsagn1 joined
11:14 <Ariakenom> equality for functions from "bounded, enumerable arguments" to "results that have equality".
11:14 keepLearning512 joined
11:15 <pally> You knew I needed that explanation hah
11:15 <pally> Ariakenom, is 'all' a keyword?
11:15 kai_w joined
11:15 <Ariakenom> :t all
11:15 <lambdabot> Foldable t => (a -> Bool) -> t a -> Bool
11:15 <Ariakenom> no
11:16 <Ariakenom> eh, consider t=[]. (a -> Bool) -> [a] -> Bool
11:16 arkaros joined
11:16 <Ariakenom> predicate -> list -> bool
11:17 AndreasPK_ joined
11:17 gabcoh joined
11:17 <Ariakenom> all p xs = does all elements of xs satisfy p
11:18 emilypi joined
11:18 encod3 joined
11:19 rcdilorenzo joined
11:19 sdothum joined
11:20 Mutter joined
11:21 nwf joined
11:23 gabcoh joined
11:24 camsbury joined
11:25 thehivemind5 joined
11:26 rprije joined
11:27 keepLearning512 joined
11:28 gabcoh joined
11:28 Sampuka joined
11:28 Tops2 joined
11:30 merijn joined
11:30 <Tops2> What might be wrong if the html created by criterion shows blank space where the charts should be?
11:30 <pally> That is a very concise and cool way to determine predicate satisfiability for a domain of discourse (in this case, [minBound..maxBound])
11:31 thehivemind5 joined
11:33 <cocreature> Tops2: I’m just guessing here but maybe the js is being blocked?
11:33 gabcoh joined
11:33 <Ariakenom> > all even [2,4..99]
11:33 <lambdabot> True
11:34 <pally> even 5
11:35 encod3 joined
11:35 <pally> > even 5
11:35 <lambdabot> False
11:35 <pally> Ariakenom, 'True'? wth happened there?
11:36 <Ariakenom> > [2,4..9]
11:36 <lambdabot> [2,4,6,8]
11:36 <Ariakenom> > [2,4..19]
11:36 <lambdabot> [2,4,6,8,10,12,14,16,18]
11:37 <pally> > [1, 1..10]
11:37 <lambdabot> [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1...
11:37 <maerwald> anyone using brittany? how annoying is it
11:37 encod3 joined
11:37 <pally> okay, I guess I don't know how it works.
11:37 <quicksilver> I think it is a poor intuition to think of haskell classes as being like OOP interfaces either.
11:38 <quicksilver> they are, obviously "structurally" like them
11:38 <quicksilver> but it's still a bad intuition.
11:38 <reactormonk> ... but inherently more powerful
11:38 <maerwald> why? Java people seem to like haskell classes and use them for similar puproses
11:38 <maerwald> with success
11:38 <dminuoso> maerwald: because of contexts
11:38 <dminuoso> and you can have typeclasses without methods
11:38 skeuomorf joined
11:38 <maerwald> I don't see the problem
11:38 gabcoh joined
11:39 vurtz joined
11:39 <Ariakenom> pally: [first,second..last]. second-first becomes the step length. so 1-1=0 doesn't move
11:39 <maerwald> intuition is intuition, it's fuzzy and artistic, not a precise reflection of technical properties
11:39 <quicksilver> haskell typeclasses are fundamentlly a tool for overloading
11:39 <quicksilver> not for describing an abstract interface.
11:40 <quicksilver> in haskell it's more idiomatic to use a data type to describe an abstract interface.
11:40 <dminuoso> quicksilver: you could say that an interface *is* a tool for overloading too
11:40 <quicksilver> sure
11:40 <pally> Ariakenom, lol...I am such a fool :-(
11:40 <quicksilver> I didn't say otherwise :)
11:40 <Ariakenom> pally: haha. why so harsh?
11:40 <quicksilver> I just say that, insofar as OOP interface are often used as an abstraction tool, that is often not the right way to use a haskell typeclass.
11:41 <quicksilver> people do use haskell typeclasses in this way, which is fair enough
11:41 <quicksilver> but it's often not the best way in my view.
11:41 <maerwald> disagreeing on design patterns...
11:41 <pally> Ariakenom, b/c I just demonstrated it by mis-interpreting the list construct.
11:42 <cocreature> quicksilver: I agree that it’s not a great intuition but I think it’s a useful one for nudging people that confuse oop classes and haskell typeclasses in the right direction
11:42 thehivemind5 joined
11:43 <quicksilver> maerwald: many aspects of many programming languages are technically equivalent.
11:43 <quicksilver> perl regexps and C++ templates are turing complete
11:43 <Ariakenom> not really a fan of it myself. prefer start step and exclusive stop
11:43 <quicksilver> but it is not idiomatic (or wise, in my view) to write entire programs within the regexp or template systems.
11:44 <quicksilver> at some point, you have to talk about idiom or good design.
11:44 <maerwald> maerwald: what is idiomatic and what is not is not defined anywhere, it's opinion too
11:44 gabcoh joined
11:44 <quicksilver> absolutely
11:44 <quicksilver> everything I saw is my opinion.
11:44 <quicksilver> say.
11:44 <Ariakenom> went philosophical there for a moment quicksilver
11:45 <quicksilver> I think sharing opinions about how to write haskell programs is a valuable endeavour in this channel.
11:45 keepLearning512 joined
11:45 <maerwald> it's valid, but not really valuable imo
11:45 <hodapp> a lot of things are "not defined anywhere", yet still have tendencies beyond mere preference
11:45 <maerwald> it rarely leads to any conclusion
11:46 <maerwald> I don't like transformers, yet people still use them, so what
11:46 <dminuoso> A discussion need not end in a conclusion to be useful.
11:46 <maerwald> is it idiomatic or not? In don't know
11:46 <maerwald> dminuoso: yes and it's still not valuable
11:46 <dminuoso> maerwald: If you do not find it valuable, don't participate then.
11:47 <maerwald> don't tell me what to do :>
11:47 language_agnosti joined
11:47 <dibblego> it is valuable though
11:48 <maerwald> dibblego: it's merely exchanging personal preferences, much like "I'm a vim user"
11:48 emilypi joined
11:48 <dibblego> no
11:48 <dminuoso> It's about exchaging personal experiences, not preferences.
11:48 <dminuoso> About view points that can be argued.
11:48 <maerwald> if there is actual technical impact, then that can be exchanged
11:48 <maerwald> and that will be valuable
11:49 <maerwald> these discussions however are rarely connected to significant project experience
11:49 gabcoh joined
11:49 <dibblego> have better discussions then
11:49 <dibblego> Try it.
11:49 p0lyph3m joined
11:49 <hodapp> maerwald: what is significant project experience and what is not is not defined anywhere, it's opinion too
11:49 <maerwald> dibblego: sorry?
11:50 <dibblego> Better discussions, try having them, such that they are valuable.
11:50 <maerwald> I have no idea what that is supposed to mean
11:50 fmixing joined
11:51 <maerwald> but we are approaching ad hominem land
11:51 <hodapp> also, try acknowledging that you need not approve of, understand, or be able to rigidly classify communications for them to have value
11:51 <maerwald> try not to tell me what to do
11:51 <hodapp> try not to act like a surly 15-year-old
11:52 <maerwald> thanks for ad hominem
11:52 cur8or joined
11:53 <dibblego> that's not ad hominem
11:53 <dibblego> this is
11:53 <dibblego> since you are a surly 15 year old, you are not making any sense
11:53 alexteves_ joined
11:53 <maerwald> can someone stop the aggressive tone here?
11:53 <dibblego> similarly, since you are a surly 15 year old, you are making a lot of sense
11:54 <dibblego> both of these are ad hominem arguments
11:54 fmixing joined
11:54 <* hackage> docker-build-cacher 2.0.0 - Builds a services with docker and caches all of its intermediate stages http://hackage.haskell.org/package/docker-build-cacher-2.0.0 (lorenzo)
11:54 gabcoh joined
11:54 <jchia_> Is there documentation on the changes from conduit-1.2 to conduit-1.3, e.g. some blog post? A lot seems to have changed.
11:54 <hodapp> "aggressive tone", like an aggressive insistence that communication you don't understand must be without value?
11:55 <maerwald> hodapp: you haven't read any of what I said carefully, sorry
11:55 <maerwald> and at this point, the discussion is over
11:55 <hodapp> maerwald: and that's an *actual* ad hominem
11:55 <hodapp> since now we're counting apparently
11:55 <maerwald> no, it isn't :)
11:55 <gonz_> maerwald: None of the things said about you were particularly wrong, tbh
11:56 <reactormonk> jchia_, mostly deprecated things have finally been removed IIRC
11:56 <hodapp> maerwald: I accept your apology.
11:57 <* hackage> valor 0.0.0.1 - Simple general structured validation library http://hackage.haskell.org/package/valor-0.0.0.1 (LukaHadziegric)
11:57 <maerwald> hodapp: there was none
11:57 <jchia_> reactormonk: Theres the move to use the new resourcet, with the attendant changes related to MonadUnliftIO. The MFunctor is gone, but I don't think that has to do with deprecation. I'm not sure what else. I'm trying to update my code to the new version.
11:57 dsh joined
11:57 ammazza joined
11:58 <cocreature> jchia_: have you looked at the changelog?
11:58 <jchia_> cocreature: Where is it?
11:58 <cocreature> jchia_: it’s listed on the hackage page
11:58 <cocreature> or find it in the git repo
11:59 <jchia_> cocreature OK, I see it. I'll take a look
11:59 drets_ joined
11:59 gabcoh joined
12:00 <maerwald> gonz_: if calling out people 15 year olds in case you disagree with them is what you consider a "better discussion", then ok :)
12:01 keepLearning512 joined
12:01 curious_corn joined
12:01 <gonz_> I'm pretty sure people who didn't even disagree with you thought you were acting like a child
12:01 silver joined
12:01 lumm joined
12:01 refold joined
12:02 <gonz_> I didn't even care about what you were discussing and still found almost everything you wrote annoying. Not because of the points you made, but how you made them.
12:02 <gonz_> Even starting with "14:39:54 <maerwald> disagreeing on design patterns..."
12:03 adjofun joined
12:03 <maerwald> no idea what you read into that
12:03 kapil___ joined
12:04 <adjofun> Hello everyone! Can someone tell me, is affine lambda calculus stricter than typed lambda calculus?
12:05 MomusInvictus joined
12:05 gabcoh joined
12:05 cybai joined
12:05 tomphp joined
12:06 <dstolfa> adjofun: could you clarify that question a little bit? what do you mean by "affine" here and what do you mean by "typed", do you mean simply typed, as in terms depending on types without any polymorphism?
12:06 thehivemind5 joined
12:07 <dstolfa> do you mean second order lambda calculus?
12:07 Mutter joined
12:07 <adjofun> dstolfa: I guess, my question can be clarified like this: Is Rust type system stricter than Haskell's? =:)
12:08 <electrocat> what do you mean by 'stricter'
12:08 reactormonk joined
12:08 <adjofun> I am aware about the proposal to add linear (or affine) types to haskell, so I am curious
12:08 <dstolfa> rust's type system has affine types in the sense that you can use it at most once (but you don't HAVE to use them once). its type system also implements a kind of separation logic that asserts ownership and prevents aliasing + mutability
12:10 gabcoh joined
12:10 <Ariakenom> dstolfa: Does GHC technically have those capabilities?
12:10 <adjofun> electrocat: I think, "stricter" in current context means "has more definitions"
12:11 <dstolfa> Ariakenom: what capabilities?
12:11 <Ariakenom> linear types, separation logic
12:11 <Cale> adjofun: It's hard to compare, they both have infinitely many definitions, and they have different non-overlapping features...
12:11 Mrd1 joined
12:11 <dstolfa> Ariakenom: i'm not aware of haskell having separation logic in its type system
12:12 <dstolfa> but definitely not linear types
12:12 <dstolfa> linear types means you HAVE to use it once. this is not the case in haskell
12:12 amirpro joined
12:12 <adjofun> http://staff.mmcs.sfedu.ru/~ulysses/Talks/2018-linear-haskell/#1
12:13 dogweather joined
12:14 tzemanovic joined
12:14 <quicksilver> Ariakenom: the current/traditional GHC type system does not, no
12:14 <quicksilver> the proposal is a way to add some of it
12:15 <* quicksilver> studied separation logic many years ago, can't quite believe some of it might finally arrive in haskell
12:15 <Cale> adjofun: Yeah, there's a lot of work left to do to say how it might interact with everything else in Haskell
12:15 amirpro joined
12:15 gabcoh joined
12:15 <Ariakenom> dstolfa: But I've heard you can encode linear types. Maybe here? http://functorial.com/Embedding-a-Full-Linear-Lambda-Calculus-in-Haskell/linearlam.pdf
12:15 <drets_> Is there a way to have default record, override the record field but apply some function to record field inside default record? :crazy: https://lpaste.net/2354377737386328064
12:16 <hpc> at some point once all this is implemented, i hope someone makes a fully automatic rust ffi
12:16 <hpc> once haskell has rust's type system, the types of rust values can be imported wholesale without having to have the programmer translate things (like the C ffi currently does)
12:17 <hpc> and things that don't use sufficiently advanced haskell features can be exported the same way
12:17 <dstolfa> hpc: that's not as easy as you might think. having similar properties in your type system doesn't mean that you can just get the FFI for free
12:17 thehivem_ joined
12:17 <reactormonk> hpc, then rust is to haskell what java is to scala ^^
12:17 <hpc> yeah, there's still a lot more to it like rust getting an abi
12:17 <dstolfa> reactormonk: i wouldn't make that analogy. haskell is much nicer than rust
12:17 <cocreature> it’s also not sufficient to have a somewhat similar type system, you need to have exactly the same type system at the edge between the two languages
12:18 <adjofun> Cale: I advertised Haskell to my c++ colleague on the grounds of STM, and now I told him about linear types. He thinks that GCs are evil, but likes Haskel, so he is excited =:)
12:18 <dstolfa> adjofun: GCs are pretty evil
12:18 <hpc> dstolfa: rust is surprisingly similar to haskell
12:18 <reactormonk> dstolfa, rust offers different guarantees, and you pay a price for it.
12:18 <hpc> dstolfa: even down to how {;} works, it's basically do-notation
12:18 <hpc> with the caveat that a trailing ; means (>> return ())
12:19 hphuoc25 joined
12:19 <hpc> and the last expression is implicitly returned
12:19 <dstolfa> hpc: it is, and the optional type is similar to the maybe monad, but i still argue it's much dirtier because it doesn't expose async and the likes through a monadic interface :)
12:19 fsvehla joined
12:19 <Ariakenom> (linear types wont get rid of gc, in particular they dont guarantee usage in the presence of exceptions)
12:19 <hpc> that's true
12:19 <iron_houzi> Are there any tools for stepping through code evaluation as a visual aid for learning?
12:19 glittershark joined
12:20 <maerwald> dstolfa: rust and haskell don't solve the same problem, it's not fair to compare them that way imo
12:20 <dstolfa> maerwald: i agree
12:20 <adjofun> so, what should I say to my colleague? Is Haskell more expressible than Rust, but still doesn't have linear types because reasons?
12:20 <dstolfa> maerwald: but then again, people compare languages all the time :P
12:20 <adjofun> Or is the question il-defined?
12:20 <adjofun> ill*
12:20 <Cale> I'm not sure I've ever had whatever problem it is that rust is aimed at solving.
12:20 <dstolfa> adjofun: it's ill defined IMO
12:20 osa1 joined
12:20 <maerwald> Cale: sytems programming :> but then again their stdlib s*cks hard
12:20 gabcoh joined
12:21 <dstolfa> Cale: rust aims at solving the problem that thinking about aliasing and mutability at the same time is hard
12:21 <dstolfa> that's it
12:21 <dstolfa> and they use separation logic to back it up
12:21 thehivemind5 joined
12:21 <maerwald> I really prefer writing GTK guis in rust over haskell
12:21 <maerwald> a lot
12:21 <maerwald> C APIs are bad anyway, but mapping them to haskell often is really awful
12:21 <dstolfa> maerwald: i think my biggest gripe with rust is the use of "lifetimes" as a name
12:21 andyhoang joined
12:22 <cocreature> dstolfa: if that’s your biggest gripe then you must like rust a lot :)
12:22 <dstolfa> cocreature: i do like rust :)
12:22 <maerwald> the biggest problem is probably futures ;)
12:22 bahamas joined
12:22 <maerwald> and how hard they are
12:22 SenasOzys joined
12:23 <dstolfa> maerwald: i'm just going to say: polymorphic polyadic pi calculus for concurrency is love and life.
12:24 <* dstolfa> likes milner's and david turner's work on pi calculus due to it being concise and providing the ability to get rid of garbage collection and typecheck that no partial deadlocks exist
12:24 <reactormonk> iron_houzi, a few basic ones on lambda calculus, but because of the laziness, stepping isn't as simple as you think it would be.
12:24 petermw joined
12:24 pbgc joined
12:24 <adjofun> dstolfa: most programmers still aren't sure that they need math, what are you talking about =:)
12:25 Vulfe joined
12:25 <hodapp> adjofun: shhhhh just don't call it math, you can sneak it past them
12:25 <dstolfa> ^
12:25 <dstolfa> i often call it "properties" and "guarantees"
12:25 <dstolfa> and when talking about category theory, i talk about galois connections
12:25 <dstolfa> and sets
12:25 <hodapp> like how my dad still thinks he can't program, but only if you call it "programming" because that gives him flashbacks of COBOL and punch cards from college
12:25 <iron_houzi> reactormonk: I understand then that stepping can be difficult to do during runtime like that .. it's just that my head hurts so bad from unnesting complex expressions ..
12:26 <adjofun> oh, THAT is what i am doing wrong then
12:26 gabcoh joined
12:26 <Cale> iron_houzi: what are you trying to understand?
12:27 <dstolfa> if you mention: "maths" to everyday programmers, you lose half of your audience right away. if you talk about group theory and algebra, maybe 1/10th of the room understands you, if you bring up category theory, you've got maybe 2 people in the room following you kind of. the moment you bring up HoTT you've lost everyone (probably)
12:27 <dstolfa> that's my experience anyway
12:27 <Cale> dstolfa: If you mention them all together, you end up with exactly the population of this IRC channel.
12:27 <dstolfa> the way to talk to programmers and systems people about maths is to give them an example problem and show how you can solve it on a very specific example and talk about it in terms of compiler magic
12:27 humanoyd joined
12:28 <dstolfa> Cale: :')
12:28 <iron_houzi> Cale: 2.3 parser combinators in http://www.cs.nott.ac.uk/~pszgmh/monparsing.pdf .. how seq on p.6 combines item and result
12:29 <iron_houzi> Cale: sorry, bind and result I mean
12:30 <Cale> iron_houzi: Okay, so the best way to do that is not to inline the definition of bind (though you can do that, it's just going to make a mess that you'll have to carefully tidy up)
12:30 <iron_houzi> Cale: inline as in infix?
12:30 <Cale> As in replace bind with its definition
12:31 <iron_houzi> Cale: Ah, OK. This is the typical replacement evaluation technique I'm used to. Do you have a better suggestion?
12:31 <Cale> It's better to understand bind in isolation, and then use that understanding to understand what this parser means
12:31 henriksod joined
12:33 Linter joined
12:33 cow-orker joined
12:33 youtmon joined
12:33 <iron_houzi> Cale: Not sure exactly what you mean. I can parse the bind function I think. It just combines a normal Parser function (Parser a) with a function I call a "terminator" parser (a -> Parser b) .. is there more to it than that?
12:35 thehivemind5 joined
12:35 <Cale> i.e. this will be the parser which parses the initial portion of the input with p, getting some result x, and then parses whatever remains with q, getting some result y, and then produces (x,y) as its result
12:35 <Cale> and it does this in all possible ways (since p and q may produce many pairs of result and depleted input string)
12:35 merijn joined
12:36 zdenal joined
12:36 <Cale> and of course, in each case, the depleted input from the combined parser is what's left over by q
12:37 <iron_houzi> Cale: Perhaps the devil is in the details here .. one thing that strikes me as odd is, why the type of bind isn't `Parser a -> (a -> Parser a) -> Parser a`. Also, something else I don't understand: Does `Parser (a, b)` mean a parser where the type value is a tuple of type a and type b?
12:37 <Cale> Well, because it's more general
12:37 <Cale> yes
12:37 <Cale> So, in this case, for example, we might have
12:38 <Cale> p :: Parser Integer
12:38 <Cale> q :: Parser Employee
12:38 <iron_houzi> OK
12:38 <Cale> and then p `seq` q :: Parser (Integer, Employee)
12:38 zdenal_ joined
12:39 <Cale> (it's sort of unfortunate that they happened to call this operation seq, since that's already something in Haskell, though I'm not sure about in 1996 when this was written)
12:39 zdenal_ joined
12:39 <iron_houzi> Yeah, I just called it myseq in my code..
12:40 <dminuoso> Cale: Mild pedantry, its something in *GHC
12:40 blackandblue joined
12:40 <Cale> dminuoso: seq is specified in the Report
12:40 <dminuoso> Oh it is? Where?
12:41 <quicksilver> dminuoso: https://www.haskell.org/onlinereport/basic.html 6.2
12:41 <Cale> It's part of the Prelude
12:41 <dminuoso> Wow I apologize.
12:41 <quicksilver> or search for "force the evaluation of a value"
12:41 <quicksilver> some pre-98 versions of Haskell had it typeclass-bounded
12:41 davr0s joined
12:42 <maerwald> anyone uses transformer-eff? The blog post introducing it looks interesting, but
12:42 gabcoh joined
12:42 <dminuoso> That's interesting, I remember Simon Marlow talking how carefully they avoided talking about execution order.
12:42 znack joined
12:42 <dminuoso> So this is why `seq` is in the report but `pseq` is not
12:43 <Cale> I think it might have been Haskell 98 that introduced seq actually
12:43 <Cale> Yeah, it's not in the 1.4 prelude
12:43 <dminuoso> Cale: I guess its time to read the report beginning to end now.
12:43 <quicksilver> the subtleties of the difference between seq and pseq have occupied a lot of minds :(
12:43 <dminuoso> So this doesnt happen again =)
12:43 <Cale> oh, right, it is, but it's not quite the same thing
12:44 <Cale> class Eval a where
12:44 <Cale> seq :: a -> b -> b
12:44 <Cale> strict :: (a -> b) -> a -> b
12:44 <Cale> strict f x = x `seq` f x
12:44 <Cale> :)
12:44 youtmon joined
12:44 <Cale> It's just an ordinary type class method in 1.4, with no magic
12:44 <dminuoso> Its interesting to see `seq` in the Haskell report. What might the justification be?
12:45 <Cale> Well, it's something to be specified...
12:45 <dminuoso> Is it to guarantee that Haskell implementations give a way to control strictness?
12:45 matsurago joined
12:45 <Cale> The Haskell report ought to report on what Haskell is
12:45 <quicksilver> dminuoso: yes, some times you get really terrible behaviour without the ability to control evaluation
12:45 <Cale> It's just unfortunate that it's way out of date and doesn't actually cover a lot of stuff any longer
12:45 <quicksilver> unfortunately(?)
12:45 dexhunter joined
12:46 forell joined
12:47 <Cale> Really, most of the programmer-facing language features in GHC, it would be nice to have some sort of description of in the Report.
12:47 <Cale> Perhaps compartmentalised in the same way into language extensions
12:47 gabcoh joined
12:48 <Cale> (since Haskell 2010 introduced the LANGUAGE pragma, but didn't get a whole lot of use out of it on its own)
12:49 <Cale> The problem is that it's tricky to actually find a nice readable way to write down what's there and how everything ought to work
12:49 mizu_no_oto joined
12:49 <Cale> https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/jfp-outsidein.pdf does a bunch of stuff...
12:50 glittershark joined
12:51 <Cale> But it's almost a book in its own right and doesn't actually cover anything beyond a limited (though broad) fragment of the type system.
12:51 <maerwald> lol, ICS AG
12:51 <maerwald> I worked there once
12:52 <Cale> But then, it's also much more detailed than what you might want in the Report as well..
12:52 <maerwald> didn't know Martin Schulzmann was there
12:52 <Cale> (and in other ways more general)
12:53 gabcoh joined
12:55 tangmou joined
12:56 ziyourenxiang joined
12:57 curious_corn joined
12:58 gabcoh joined
13:03 gabcoh joined
13:04 glittershark joined
13:08 gabcoh joined
13:09 tzemanovic joined
13:09 keepLearning512 joined
13:09 AndreasPK__ joined
13:09 tzemanovic joined
13:10 tzemanovic joined
13:10 perspectival joined
13:11 Saukk joined
13:11 tzemanovic joined
13:11 <hodapp> anyone have a favorite library for generating triangle meshes?
13:11 xkapastel joined
13:12 tzemanovic joined
13:12 blackandblue joined
13:12 sm joined
13:13 bwe joined
13:14 glittershark joined
13:14 gabcoh joined
13:14 reorder_ joined
13:14 fizbin joined
13:15 Vulfe joined
13:15 <hodapp> saw ImplicitCAD, and I want to mess with it a bit (but for other reasons), but wanted to find something that just handles some of the simple mesh formats
13:15 patlv joined
13:15 thehivemind5 joined
13:15 ystael joined
13:17 <fakenullie> does implicitcad uses better csg engine than openscad?
13:19 tangmou joined
13:19 gabcoh joined
13:19 <iron_houzi> Cale: Is the purpose of bind to have a data "transformer" from one type of parser to another type of parser? bind takes the first parser and a function that converts the output of the first parser into the resultant parser....??
13:19 <iron_houzi> in effect binding two parsers of potentially different types ..
13:19 <Cale> iron_houzi: for parsing the remainder of the input, yes
13:20 <Cale> It's this last bit which is really important
13:20 dogweather joined
13:20 <Cale> For example, the first parser might read a number, and then the function might build a parser which will expect that many lines of input to be consumed thereafter
13:20 <iron_houzi> what "bit"? What you just said about managing the remainder of the first parser?
13:20 <Cale> yeah
13:21 <Cale> So it's like what the paper calls seq in that regard
13:21 <Cale> But rather than just ignoring the result of the first parser and continuing with the second
13:21 glittershark joined
13:21 <Cale> the second parser is allowed to depend on the result of the first parser
13:23 <iron_houzi> A function for binding two parsers, where you need one parser and a function that takes the result of this one parser and produces a second parser .. chaining the consumption of the input ..
13:23 <quicksilver> hodapp: the number of people who have done 3D mesh handling in haskell is sufficiently small that there probably aren't people online in the channel right now with an answer to your question.
13:24 <iron_houzi> It's more clear, but I still think this needs some more marinating. Thanks Cale!
13:24 <quicksilver> I did some but I did it by hand because I was only doing it for fun, not to achieve anything efficient
13:24 <hodapp> fakenullie: they're different sorts of engines. OpenSCAD is based on CGAL, which all explicit/parametric shapes and CSG to combine them, whereas ImplicitCAD behaves like Curv/libfive/Ruckus in which you work with implicit surfaces (like SDFs) in which your shape is defined by F(x,y,z) where F > 0 outside the surface, F < 0 inside the surface, F = 0 on the surface
13:24 <dminuoso> iron_houzi: Have you written/used the State monad before?
13:24 zdenal joined
13:24 gabcoh joined
13:24 <quicksilver> hodapp: I did a partial marching cubes algorithm, but I didn't handle some of the fiddly cases.
13:24 thehivemind5 joined
13:25 <Cale> Or if you've used IO or any other monad, it might help to know that bind is (>>=)
13:25 <Cale> but for parsers :)
13:25 <hodapp> fakenullie: implicit surfaces, aka F-Reps, are a lovely "functional" representation in which all sorts of things are possible and elegant through function compositions and domain transformations, including shapes that are infinite in extent or in detail
13:25 <hodapp> but they're sort of harder to render and work with
13:25 lastmanstanding joined
13:26 <hodapp> quicksilver: yeah, I was looking less at the 3D mesh handling side and more just at handling a common file format
13:26 <hodapp> if I can make it kick out a mesh, I can clean the mesh up in other tools made for it
13:27 mizu_no_oto joined
13:27 carlomagno joined
13:28 <hodapp> but hmmm. OBJ and STL aren't that complicated formats. I could probably just write my own exporter if need be
13:28 <quicksilver> actually I was partly doing it because I'd read the marching cubes paper and I didn't believe it was that complex
13:28 <quicksilver> so I tried to write an implementation myeslf to understand
13:29 <hodapp> were you turning isosurfaces to a mesh?
13:29 gabcoh joined
13:29 <hodapp> yeah, I had thought that marching cubes (or whatever the non-IP encumbered variant thereof is called) was a very simple algorithm, but then, I've never implemented it
13:30 fendor_ joined
13:30 <hodapp> I was more focusing on using SDFs to render directly via raymarching (sphere tracing, particularly)
13:30 <hodapp> at one point I was going to write a sphere tracer in Haskell via Hylogen. can't recall why I stopped
13:31 <Rembane> Did life happen?
13:31 <hodapp> lol, maybe
13:31 <* Rembane> hands hodapp a life delayer
13:31 <quicksilver> hodapp: yes, turning various kinds of implicitly defined surfaces into meshes
13:31 <hodapp> but it might have been technical reasons too, e.g. me running into some sort of technical barrier that just wasn't worth trying to get past
13:32 <cocreature> life considered harmful
13:32 <quicksilver> partly to understand the algorithm
13:32 <quicksilver> partly to experiment with visualising the algorithm
13:32 <hodapp> quicksilver: did you run into things that made it much less simple than you thought?
13:32 <quicksilver> I had some poorly constructed thoughts about how it's a pain to visualise haskell algorithms
13:32 <hodapp> huh
13:32 <quicksilver> so I wanted to be able to animate the marching cubes
13:32 <quicksilver> hodapp: there are more irreducible cases than you'd expect
13:33 thehivemind5 joined
13:34 <Cale> btw, if you happen to make a raytracer with spheres, my favourite scene is to arrange 4 spheres in a tetrahedron, tangent to one another, arrange some different coloured lights or something interesting around it, and then point the camera inward. The reflections form a fractal.
13:34 curious_corn joined
13:34 Tops2 joined
13:34 <hodapp> Cale: I've seen that before but never tried it
13:35 gabcoh joined
13:35 glittershark joined
13:35 <hodapp> but it still knocks my socks off that it's possible to raymarch things like the Julia and the Mandelbulb directly because it's possible to define a signed distance function, thus an isosurface, for the (infinitely complex) surface
13:36 <hodapp> I read the syntopia articles on how to do that, but even with the level of details those articles went into they just sort of punted to an even longer paper to explain how you turn Julia, Mandelbrot, Mandelbulb, and so on into a distance estimate function over R^2 or R^3
13:37 <hodapp> buuuut... my Haskell-mesh-generation-needs are luckily much simpler
13:38 <hodapp> I have a system I built, vaguely IFS or L-system like, that right now works in 2D and I want to make it 3D, like Structure Synth, because it works almost identically there
13:38 <Cale> If you google image search for "Wada basin" you'll find a bunch of nice examples, some from real life :)
13:38 <quicksilver> hodapp: http://roobarb.jellybean.co.uk/~jules/Picture%20145.png
13:38 <quicksilver> screenshot turns 10 years old in a couple of weeks!
13:38 <quicksilver> trying to visualise the points the cubes cut through the surface
13:39 <iron_houzi> dminuoso: Not yet, no. I believe I have heard of it though. Why?
13:39 <dminuoso> iron_houzi: State is the simpler form of Parser.
13:39 <dminuoso> Rembane: Parser a ~ StateT String [] a
13:39 <dminuoso> Woah. What in the heck was that.
13:40 machined1od joined
13:40 <dminuoso> I typed iro<tab> and weechat gave me your nickname. This is so weird..
13:40 <iron_houzi> dminuoso: Do you think I'm wasting my time in terms of learning the concepts of cominatoric monadic parsers?
13:40 <hodapp> quicksilver: hah, neat. looks like marching cubes to me.
13:40 <dminuoso> iron_houzi: Absolutely not. :)
13:40 gabcoh joined
13:40 <iron_houzi> dminuoso: OK, thanks for informing me. I'll probably be using the State monad once I have a thorough understanding of combinatoric monadic parsers
13:41 codesoup joined
13:42 Krisostoomus joined
13:42 mstruebing1 joined
13:42 enterprisey joined
13:42 crayonwitch joined
13:42 <hodapp> Cale: speaking of chaos theory, my pet project as of late has been to try to produce something that is vastly simpler than the Mandelbrot in terms of computation, but has as lot of the same sort of 'infinite detail and self-affinity' properties
13:42 <Cale> iron_houzi: It may be simpler to start with State though.
13:43 <hodapp> I started from binary cyclic tag systems, which are among the simplest Turing-complete systems, but have run into some snags getting interesting visualizations out of them
13:43 <Cale> iron_houzi: It has a lot of similarity with the Parser you're trying to understand, but is a bit simpler (though perhaps less useful)
13:43 remyhr joined
13:43 mizu_no_oto joined
13:43 <iron_houzi> Cale: Do you know a similar resource to the PDF I've referred to that utilizes the State monad for creating parsers?
13:43 <Cale> hmm
13:44 <dminuoso> iron_houzi: I would say just learn State in the general form, parsers will become obvious. :)
13:44 guessWHo joined
13:44 <Cale> iron_houzi: Well, that could be done once you get to StateT (the monad transformer corresponding to State)
13:44 <dminuoso> But YMMV
13:44 <Cale> Parser = StateT String []
13:45 glittershark joined
13:45 <Cale> but yeah, I wasn't even suggesting to do that :)
13:45 <dminuoso> plus an implied contract that each parser will only consume.
13:45 emilypi joined
13:45 gabcoh joined
13:45 <electrocat> this might be useful: http://dev.stephendiehl.com/fun/002_parsers.html
13:46 <dminuoso> Are there legit reasons to put things into the stream in a parser?
13:46 <iron_houzi> Cale: The thing is, the document makes a lot of sense on the high level .. it makes the basic concepts very easy to understand .. it just becomes a bit black box when it comes to understanding the fine details .. I hit a wall on page 9 when the authors switch to using actual monads and the type alias stops working. I'm unable to convert the type alias to a data type .. which is why I'm trying to understand
13:46 <iron_houzi> the fine details .. any help on this would be greatly appreciated
13:46 Vulfe joined
13:47 <Rembane> dminuoso: ^^ it's the quantum effects.
13:47 <hodapp> quantum... effects?
13:47 alexad joined
13:47 <iron_houzi> dminuoso: I'll most certainly get to State monad at some point. I'll have a look today and see if it helps with what I'm doing now.
13:47 <Cale> iron_houzi: ah, you'll want to make it into a newtype
13:47 <Cale> iron_houzi: and then insert the newtype's data constructor as appropriate
13:48 <Cale> i.e. newtype Parser a = P (String -> [(a, String)])
13:48 eschnett joined
13:48 <Cale> runParser :: Parser a -> String -> [(a,String)]
13:48 <dminuoso> @let data State s a = State { runState :: s -> (a, s) }
13:48 <lambdabot> Defined.
13:49 <Cale> runParser (P f) s = f s
13:49 fendor_ joined
13:49 <iron_houzi> Cale: This is as far as I've managed to get .. but it must be a dead end: https://github.com/ironhouzi/hstib/blob/tib_monad/src/Main.hs#L279-L290
13:49 <Cale> and indeed, you could use record syntax to do that automatically
13:49 <iron_houzi> Cale: Oh, this is very interesting! Thank you!
13:49 <Cale> iron_houzi: Oh, you're already getting there
13:49 <Cale> iron_houzi: (the difference between data and newtype is minor here)
13:50 <Cale> iron_houzi: Mainly, you just need to remember to use your data constructor when you want to build a value of type Parser
13:50 <Cale> I called it P, you called it Parser
13:50 Vulfe joined
13:50 <iron_houzi> right, .. thank you so much!
13:50 gabcoh joined
13:51 <Cale> iron_houzi: I actually find that explicitly using runParser in these definitions makes them more readable
13:51 <Cale> rather than pattern matching
13:53 <WhatisRT> Hi! Is there any (non horribly complicated) way of turning typeclass restrictions of functions into parameters?
13:53 hphuoc25 joined
13:53 <WhatisRT> For example I want to turn sort into sort' :: (a -> a -> Bool) -> [a] -> [a]
13:53 <alexad> Recommendation for a decent jose lib with full-ish JWE support?
13:53 <Cale> Well, not automatically, really
13:55 <dminuoso> WhatisRT: What are you trying to do?
13:56 thehivemind5 joined
13:56 gabcoh joined
13:56 <WhatisRT> dminuoso: I want to offer such functions over a FFI
13:56 <tdammers> is fpcomplete's hackage mirror flaky for anyone else, or is it just me?
13:57 <ventonegro> WhatisRT: You can manually rewrite interfaces as records
13:57 Psybur joined
13:57 scottschmidt1 joined
13:59 <* hackage> composition-prelude 1.5.0.4 - Higher-order function combinators http://hackage.haskell.org/package/composition-prelude-1.5.0.4 (vmchale)
13:59 <WhatisRT> ventonegro: I'm not sure what you mean - I can of course use a helper data type, but I have difficulty in getting it general enough
13:59 <dminuoso> :t Comparison
13:59 <lambdabot> error: Data constructor not in scope: Comparison
13:59 <ventonegro> WhatisRT: You would need one for each typeclass you want to pass to the FFI
14:00 dolio joined
14:00 <dminuoso> @let import Data.Functor.Contravariant
14:00 <lambdabot> Defined.
14:00 <[exa]> WhatisRT: did you see how the typeclass members are mangled after just typechecking?
14:00 <dminuoso> :t Comparison
14:00 <lambdabot> (a -> a -> Ordering) -> Comparison a
14:00 mikelui joined
14:00 <nshepperd_> You can rewrite the function that uses a typeclass to use plain functions instead
14:00 phryk joined
14:01 <* hackage> influxdb 1.6.0.4 - Haskell client library for InfluxDB http://hackage.haskell.org/package/influxdb-1.6.0.4 (MitsutoshiAoe)
14:01 <nshepperd_> If it's not your function, reflection package is the way to run it with a "dynamic" typeclass instance
14:01 curious_corn joined
14:01 gabcoh joined
14:02 <dmwit> WhatisRT: Are source-to-source transformations "horribly complicated"?
14:02 <WhatisRT> dmwit: I may not have access to the source
14:03 <WhatisRT> So I cannot rely on these
14:03 <dmwit> Then reflection is likely your best bet.
14:03 mnoonan joined
14:04 MomusInvictus joined
14:06 thehivemind5 joined
14:06 gabcoh joined
14:07 <WhatisRT> Seems like I have to spend an hour or so getting this library :)
14:07 <WhatisRT> Thanks!
14:07 <shapr> @quote Cale
14:07 <lambdabot> Cale says: I even go through google blog search and pick up random bloggers saying "I tried Haskell last weekend" and so on, and leave a remark for them to come here. :)
14:07 <shapr> yay!
14:08 iAmerikan joined
14:08 acarrico joined
14:08 davr0s joined
14:08 <jchia_> many is defined in both GHC.Base and Control.Monad.Combinators (from package parser-combinators). So I get duplicate definitions when I use both Control.Applicative and Text.Megaparsec. Why does parser-combinators define its own many?
14:08 <fakenullie> hodapp: but implicitcad doesn't seem to allow arbitrary functions
14:08 <Ariakenom> :t many readLine
14:08 <lambdabot> error:
14:08 <lambdabot> • Variable not in scope: readLine :: f a
14:08 <lambdabot> • Perhaps you meant one of these:
14:09 <hodapp> fakenullie: what do you mean?
14:09 <Ariakenom> :t many getLine
14:09 <lambdabot> IO [String]
14:09 <jchia_> It's quite messy because now I can't import Control.Applicative and Text.Megaparsec unqualifiied.
14:09 <fakenullie> hodapp: write my own F(x, y, z) instead of composing provided functions
14:09 arkaros joined
14:09 <Ariakenom> jchia_: you can use hiding in your import
14:09 <hodapp> fakenullie: it doesn't allow that? I haven't looked in detail but I swore it did
14:09 adkron_ joined
14:09 <jchia_> Ariakenom: I know. It's just messy.
14:09 <hodapp> so far it is only libfive and Curv that I have worked with directly, though
14:10 <jchia_> I don't understand why parser-combinators has to define its own. Is it different than the one from base?
14:10 ddellacosta joined
14:10 dbmikus joined
14:10 UnkDevE joined
14:11 <UnkDevE> is anyone there?
14:12 gabcoh joined
14:12 <Cale> plenty of people are here
14:12 <dmwit> No people, just us crickets.
14:12 otto_s joined
14:12 <Cale> shapr: It's been quite a while :)
14:13 <shapr> Cale: yeah, I've noticed the quotes are getting old
14:13 <dmwit> jchia_: Historical accident, most likely. Parsec had it because parsec predated Alternative, and I suspect parser-combinators has it because parsec had it.
14:13 <shapr> I'm tempted to add in date added and weight the random choice for newer quotes.
14:13 <Cale> WhatisRT: I would recommend just reframing your problem somehow so that you're not faced with turning typeclass instances into data.
14:14 <jchia_> dmwit: To be clear: Control.Monad.Combinators.many (from parser-combinators) vs Control.Applicative.many (from base)
14:14 <dmwit> jchia_: I don't think that clarification changes my answer.
14:14 <jchia_> One is for MonadPlus and one for Alternative
14:14 <jchia_> I think I wasn't very clear before.
14:14 JanBessai joined
14:14 Solonarv joined
14:15 bahamas joined
14:15 <WhatisRT> Cale: I can't. My problem requires that the instances of type classes have to be created at runtime.
14:15 td123 joined
14:15 thehivemind5 joined
14:16 <WhatisRT> Or at least that they can be created at runtime
14:16 phryk joined
14:16 keepLearning512 joined
14:16 <dmwit> WhatisRT: prove it
14:16 <shapr> there's very likely a different approach
14:16 Azel joined
14:16 <jchia_> dmwit: I don't understand why in parser-combinators they didn't remove the definition of when compiling with recent versions of base. They could use a CPP version check.
14:17 <dmwit> jchia_: Okay. Do you believe understanding would change your behavior?
14:17 <jchia_> Because MonadPlus implies Alternative, so there's already a many from Control.Applicative.
14:17 gabcoh joined
14:17 <WhatisRT> I want to turn haskell functions into c++ functions of the same type
14:17 camsbury joined
14:17 <WhatisRT> At least as far as it makes sense
14:17 <hodapp> fakenullie: hmm, you might be right. that surprises me about ImplicitCAD, since the other 'similar' frameworks let you do arbitrary functions and it's half the point of them
14:17 danthemyth joined
14:18 <Cale> WhatisRT: Since Haskell's type system has types in it that have no corresponding type in C++, that doesn't make sense for all Haskell functions.
14:18 <jchia_> dmwit: There are two possibilities. There is a good reason for the Control.Monad.Combinators.many to exist or there isn't. If there is, I'll import hiding many. If not then maybe I'll post an issue for parser-combinators.
14:18 camsbury joined
14:18 <dmwit> jchia_: There isn't.
14:18 <WhatisRT> Cale: yes, but in most cases it will work
14:18 <Cale> In particular, C++ doesn't have type classes, so you can safely ignore anything which is type class polymorphic.
14:19 p0lyph3m joined
14:19 <jchia_> dmwit: OK, I'm making a github issue
14:19 <WhatisRT> Well, or I can add another argument to remove the typeclass restriction
14:20 <WhatisRT> That's precisely why I want to do that
14:20 p0lyph3m joined
14:21 bollu joined
14:22 gabcoh joined
14:23 reactormonk joined
14:23 vurtz joined
14:23 <alexad> fuuuck
14:24 <alexad> I can't find a JOSE lib for haskell with RSA_OAEP_256 support
14:25 thehivemind5 joined
14:25 karlguy joined
14:25 <dmwit> Hey, grats, you get to write more Haskell now!
14:25 JanBessai joined
14:25 <ventonegro> Lucky bastard
14:26 MomusInvictus joined
14:27 ogrady_ joined
14:27 chaosmasttter joined
14:27 conal joined
14:27 <alexad> dmwit, looks like
14:27 eschnett joined
14:27 ozataman joined
14:27 <alexad> my hackathon is becoming a forking effort
14:27 bollu joined
14:28 tomphp joined
14:28 xtreak joined
14:29 bbrodriguez joined
14:29 tangmou joined
14:32 <jchia_> dmwit: I think actually there's a special reason. The documentation fro Control.Monad.Combinators says "The module provides more efficient versions of the combinators from Control.Applicative.Combinators". Newer versions of megaparsec reexport from Control.Monad.Combinators instead of Control.Alternative.Combinators.
14:33 keepLearning512 joined
14:33 bbrodriguez joined
14:34 tangmou joined
14:35 tomphp joined
14:35 thehivemind5 joined
14:36 tomphp joined
14:37 tomphp joined
14:37 tomphp joined
14:39 refold joined
14:41 zdenal_ joined
14:41 bak1an joined
14:47 thehivemind5 joined
14:49 mceier joined
14:49 glittershark joined
14:49 tangmou joined
14:50 pio_ joined
14:51 knupfer joined
14:52 ericsagn1 joined
14:53 Capattack77 joined
14:53 iAmerikan joined
14:54 tangmou joined
14:54 urodna joined
14:55 remyhr joined
14:55 Claudius1aximus joined
14:56 thunderrd joined
14:57 scottschmidt1 joined
14:57 killtheliterate joined
14:57 <cocreature> I still don’t quite know what this statement is supposed to refer to
14:58 killtheliterate left
14:58 camsbury joined
14:59 thehivemind5 joined
15:01 PLPD-Bot joined
15:02 Linter joined
15:03 acertain joined
15:03 tomphp joined
15:04 Sampuka joined
15:05 <hodapp> story of my life
15:06 mitchellsalad__ joined
15:08 Psybur joined
15:08 pfurla joined
15:09 jrm joined
15:09 philippD joined
15:09 Sampuka joined
15:10 conal_ joined
15:10 slaznick left
15:10 Arcaelyx_ joined
15:11 lastmanstanding joined
15:12 Luke joined
15:12 DSM joined
15:13 twk- joined
15:13 enterprisey joined
15:13 camsbury joined
15:14 beefjoe joined
15:15 <* hackage> servant-auth 0.3.2.0 - Authentication combinators for servant http://hackage.haskell.org/package/servant-auth-0.3.2.0 (domenkozar)
15:15 enterprisey joined
15:15 Wuzzy joined
15:16 enterprisey joined
15:18 thehivemind5 joined
15:18 skeet70 joined
15:20 curious_corn joined
15:20 sgraf joined
15:21 <* hackage> typenums 0.1.1.1 - Type level numbers using existing Nat functionality http://hackage.haskell.org/package/typenums-0.1.1.1 (AdituV)
15:21 rembo10 joined
15:22 <alexad> BAM done it, implemented RSA-OAEP-256 for jose-jwt :D
15:24 plugin joined
15:25 lektrik joined
15:27 thehivemind5 joined
15:28 <quicksilver> alexad++
15:28 <alexad> so, cabal stuff question... I have a local fork of a project that hasn't accepted a change I need yet... Is there a nice way I can simply use my local fork as my dependency for now as I build?
15:28 raichoo joined
15:28 <alexad> or a github point or something?
15:28 <cocreature> alexad: do you use cabal new-build?
15:28 <electrocat> alexad: purely using cabal?
15:28 <alexad> cocreature, nothing prevents me from doing so.
15:29 <alexad> electrocat, or anything not too head-screwsy
15:29 <cocreature> alexad: with "cabal new-build" you can just add the path to your local fork in the "packages" section in "cabal.project"
15:29 cetchmoh joined
15:29 <glguy> https://www.haskell.org/cabal/users-guide/nix-local-build.html#specifying-the-local-packages
15:29 <cocreature> also if you haven’t used new-build yet, you might be pleasantly surprised. it’s a lot more convenient than working with sandboxes :)
15:29 <alexad> cocreature, I suppose combined with git submodules I could use a relative path and be fine for now?
15:29 <cocreature> yep
15:31 altjsus joined
15:31 remyhr joined
15:31 <maerwald> note that cabal new-install is semi-broken
15:32 <electrocat> or non-existant depending on your version :p
15:32 <electrocat> non-existent*
15:32 <glguy> If you're not using the latest release it's time to upgrade
15:34 <electrocat> does anyone know if split-objs/sections work decently on newer versions?
15:34 DSM joined
15:34 <electrocat> it works for the package you're currently building but it seems to be ignored for the dependencies
15:36 ijks joined
15:36 davr0s joined
15:37 <cocreature> electrocat: how are you trying to pass the option?
15:37 Akaakiko joined
15:38 <electrocat> `cabal new-configure --enable-split-objs`
15:38 <maerwald> is there a more java-like doc frontend of haskell packages?
15:38 <maerwald> navigating is kinda annoying
15:39 enterprisey joined
15:39 <alexad> cocreature, so this packages definition is only for the new-build system?
15:41 <cocreature> electrocat: I’m not quite sure about the cli flags. maybe try putting "package *\n split-sections: True" in your cabal.project file instead
15:41 <cocreature> alexad: yep
15:41 enterprisey joined
15:41 <cocreature> alexad: in a hopefully not too distant future new-build will replace the existing build command
15:41 <electrocat> cocreature: ah, i'll try that later today, tnx
15:41 <cocreature> electrocat: also you really want to be using split-sections instead of split-objs if you’re GHC supports the former afaik
15:41 thehivemind5 joined
15:42 asheshambasta joined
15:42 JanBessai joined
15:42 eruditass joined
15:42 ogrady joined
15:42 <asheshambasta> Hi guys, has anyone tried to write an SSL passthrough proxy using Haskell?
15:43 <[exa]> maerwald: what do you mean by java-like?
15:43 tomphp joined
15:43 <alexad> cocreature, do these co-exist with or replace *.cabal files?
15:43 <maerwald> [exa]: https://docs.oracle.com/javase/7/docs/api/
15:43 <electrocat> cocreature: yeah, i'm aware, haven't looked into yet, build systems don't seem to have an options for it though
15:44 <electrocat> option*
15:44 <[exa]> asheshambasta: y u no haproxy/nginx? not sure if Haskell is a good implementation language for that kind of stuff
15:44 <cocreature> alexad: coexist, you still have cabal packages that are configured using .cabal files. but now you also have a cabal.project that can be composed of multiple cabal packages and is configured using cabal.project
15:44 <cocreature> electrocat: afaik "split-sections" is a cabal option
15:44 <asheshambasta> [exa]: good question, but we want to automate certificate issuance for the domains we serve (we serve hundreds) via LetsEncrypt.
15:45 <asheshambasta> There are prebuild nginx based projects that do that, but our experience with that has been mixed.
15:45 tomphp joined
15:45 <* hackage> hadolint 1.7.5 - Dockerfile Linter JavaScript API http://hackage.haskell.org/package/hadolint-1.7.5 (lorenzo)
15:45 <cocreature> I think michael snoyman experimented with integrating lets-encrypt certificate issuance into warp at some point. not sure what the current state of that is
15:45 <electrocat> cocreature: ah indeed, seems to be new
15:46 <electrocat> i don't have it yet
15:46 <cocreature> electrocat: upgrade! :)
15:46 <[exa]> asheshambasta: I'd strongly advice from writing the proxy yourself in any language, it's error-prone from so much different vectors that you don't want to know about :]
15:46 <electrocat> :D
15:46 glittershark joined
15:46 <cocreature> electrocat: I’m not kidding here, if you use the new-* stuff you really want to make sure you are using the latest version of cabal
15:46 <[exa]> asheshambasta: but, anyway -- writing modules for nginx isn't complicated and you can easily make simple haskell bindings from that thing using FFI
15:47 eruditass joined
15:47 <asheshambasta> cocreature: wow: https://github.com/snoyberg/warp-letsencrypt
15:47 darkJedi joined
15:47 <electrocat> i've noticed, currently i'm just using the version that stack lts or nix gives me
15:47 <* hackage> servant-auth-client 0.3.3.0, servant-auth-server 0.4.0.0, servant-auth-swagger 0.2.10.0, servant-auth-docs 0.2.10.0 (domenkozar)
15:47 <cocreature> asheshambasta: I have absolutely no experience with that so don’t blame me if it doesn’t work :)
15:47 <alexad> cocreature, I don't suppose you can point me at a real example of this?
15:48 <cocreature> alexad: an example of what exactly?
15:48 <asheshambasta> [exa]: point taken
15:48 sighingnow joined
15:48 scottschmidt1 joined
15:48 <glguy> alexad: Here's a cabal.project files: https://github.com/glguy/irc-core/blob/v2/cabal.project
15:49 <alexad> ooh, I need to explicitly build "all"
15:49 <[exa]> asheshambasta: you don't want to shovel the raw data through haskell, but I imagine that writing some not-timing-critical certificate event-handling stuff can be easily offloaded
15:49 <cocreature> alexad: or the package that you are interested in
15:50 thehivemind5 joined
15:50 <asheshambasta> [exa]: yeah – I guess interfacing nginx with Haskell via the FFI isn't a bad idea at all
15:51 <[exa]> maerwald: if you mean 'list of modules by module name, not package name'...I'd like that very much as well :]
15:51 <[exa]> (I guess that there may be problems with overlapping module names though, we've got like at least ten different Preludes right?)
15:52 KeyJoo joined
15:52 <maerwald> no, I mean generally more structure when looking at a module
15:52 <maerwald> not hit back and forth all the time
15:52 xtreak joined
15:53 <[exa]> asheshambasta: well wish you luck. anyway, any reason why would you need the certificate handling logic this close to the data streams?
15:53 ericsagn1 joined
15:53 <[exa]> maerwald: oh so, I kindof dislike that one on java docs :D
15:53 tomphp joined
15:54 <glguy> The newer "quickjump" stuff helps for moving around when you know about what you're looking for
15:54 <asheshambasta> [exa]: because we handle 100's of domain names, and the most efficient way imho, is to perform certificate requests and installations on the fly -- per request.
15:54 eruditass joined
15:54 HUNTER joined
15:55 huxing joined
15:55 <asheshambasta> for example, if domain xyz.com was issued a certificate at some point and then stops receiving requests for a while, we don't really need to renew its cert. until the next request
15:55 thehivemind5 joined
15:55 <[exa]> asheshambasta: sounds more like "millions of domains"
15:56 <asheshambasta> and while its certificate is expired, the client may be still upgraded to an SSL connection on the fly as the certificates are issued
15:56 <asheshambasta> [exa]: Soon :-)
15:56 <[exa]> do you realize that first requests usually contain passwords?
15:57 <[exa]> (even if this is something like CDN -- first requests usually contain images that contain passwords :D)
15:57 <asheshambasta> not in our case (where we're trying to solve this problem), its for simple websites like these: Y
15:57 <alexad> cocreature, figured it out from another example someone had posted on SO XD
15:58 eruditass joined
15:58 <asheshambasta> https://bonbol.be (sorry)
15:58 <alexad> glguy, thanks
15:58 zaquest joined
15:58 tomphp joined
15:58 doyougnu joined
15:59 Noldorin joined
16:00 ogrady joined
16:00 <[exa]> asheshambasta: I'd still go with a solution at least partially external to nginx. Having something inside will force you to be extremely efficient and try not to interfere with the lowlevel network event processing. If you can wait a little with the SSL upgrade, how about logging non-ssl queries in nginx, issuing the cert in another process, and reconfiguring that later on-the-fly?
16:01 woodson joined
16:01 catern joined
16:01 <[exa]> asheshambasta: that's 1 process for handling nginx website configurations/reloads and 1 process that checks the logs each minute and spawns renewals whenever needed
16:01 antsanto joined
16:02 <[exa]> asheshambasta: similar problem: of someone has a https:// link saved, he'll see the certificate expired page and you won't be able to see which domain he wanted
16:02 catern joined
16:02 <[exa]> ok </offtopic>
16:02 catern joined
16:02 <asheshambasta> [exa]: yeah, correct, the clients will eventually distribute their links etc. so we cannot afford to have SSL certificates expire.
16:02 amar_ joined
16:03 dan_f joined
16:03 <asheshambasta> what can alernatively be done is this haskell service keeps a record of all issued certs and the time of issue
16:03 catern joined
16:04 unyu joined
16:04 catern joined
16:04 <asheshambasta> and checks every minute for a minimum validity threshold; renews the certificates necessary (or queues the jobs)
16:04 catern joined
16:04 <[exa]> yeah, just a renewal daemon that sometimes reloads nginx (I guess nginx can reload without pausing any traffic)
16:05 zar joined
16:05 <asheshambasta> yeah, there's also something in the openresty project that allows you to make dynamic SSL certificates
16:05 <[exa]> anyway the warp-letsencrypt seems cool, if you don't have much traffic in terms of raw data, I'd love to go with that
16:07 <asheshambasta> yeah
16:08 <reactormonk> Can I have named fields in a GADT?
16:08 glittershark joined
16:08 <asheshambasta> [exa]: the thing is, we have a decent bit of traffic, so I'm not really sure at many levels, maybe I need a good night's sleep (I just started working on this today)
16:08 <glguy> Yes, GADTs have a record syntax
16:08 jdreaver joined
16:08 <asheshambasta> and by working I just mean thinking about the architecture and the direction to take for the solution; its an interesting problem nonetheless.
16:09 <glguy> reactormonk: There are examples in the GHC users's guide
16:09 djbeau joined
16:09 <reactormonk> glguy, kk
16:09 thehivemind5 joined
16:10 <asheshambasta> [exa]: in case you're interested: https://github.com/GUI/lua-resty-auto-ssl
16:12 ogrady joined
16:12 amar_ joined
16:13 <asheshambasta> question: when to use `return` and when to use `pure`?
16:13 <electrocat> asheshambasta: imo, doesn't really matter
16:14 camsbury joined
16:14 <asheshambasta> electrocat: I prefer `pure` since its shorter.
16:14 <electrocat> unless you need backwards compat
16:14 brandly joined
16:14 bahamas joined
16:15 bbrodriguez joined
16:15 thehivemind5 joined
16:15 <electrocat> i personally use pure when using applicative stuff, and return in do notation
16:15 <[exa]> in some cases you might want to force the type system to derive Monad constraint instead of Applicative....but I'm not aware of such cases.
16:16 <[exa]> yeah return looks just better in do-blocks
16:16 <electrocat> well in the future they'll be exactly the same iirc
16:16 <electrocat> just aliases
16:17 <Taneb> I prefer "pure" in all cases other than when I want to support GHC versions before Applicative was added to Prelude
16:17 <* hackage> diffmap 0.1.0.0 - diff on maps http://hackage.haskell.org/package/diffmap-0.1.0.0 (chessai)
16:17 <asheshambasta> I see
16:20 Noldorin joined
16:21 sektor joined
16:21 lel joined
16:22 SpinTensor joined
16:23 jwynn6 joined
16:23 Linter joined
16:23 thehivemind5 joined
16:25 drewr joined
16:25 diwo joined
16:25 dopplergange joined
16:26 SenasOzys joined
16:27 knupfer joined
16:28 chessai joined
16:29 akshayn joined
16:31 tsoernes joined
16:32 fendor_ joined
16:32 keepLearning512 joined
16:33 zdenal joined
16:34 tsaka__ joined
16:34 thehivemind5 joined
16:36 FreeBirdLjj joined
16:37 <Cale> asheshambasta: fwiw, I only ever use Applicative when I'm convinced that there would be some benefit to the extra abstraction
16:37 <Cale> (and tend to use return rather than pure in most places)
16:38 <asheshambasta> Cale: okay
16:38 codesoup joined
16:38 pounce joined
16:38 <asheshambasta> I was confused because I see both return and pure
16:38 <asheshambasta> (in the wild)
16:39 <Cale> Well, return is part of the definition of Monad and pure is part of the definition of Applicative, it just wasn't always the case that Applicative was a superclass
16:40 patlv joined
16:42 ski joined
16:43 amar_ joined
16:43 zdenal joined
16:47 saml joined
16:47 <saml> is haskell production ready like for web microservices
16:48 <dysfun> plenty of people use haskell in production for many years
16:48 vilu joined
16:49 t7 joined
16:50 <vilu> Hi, I'm trying to implement a Zipper using a graph for a Maze like game.
16:50 <vilu> I'm having some trouble with the implementation.
16:50 <vilu> I see very little documentation of Zippers in any other context than lists/trees
16:50 <vilu> Am I having troubles because it's not possible or because I can't see it? :)
16:51 camsbury joined
16:52 reactormonk joined
16:52 keepLearning512 joined
16:52 dogweather joined
16:53 rprije joined
16:53 <humanoyd> saml: https://github.com/Gabriel439/post-rfc/blob/master/sotu.md might be of interest to you
16:54 <saml> thanks humanoyd
16:54 <dmwit> vilu: Creating efficient zippers for structures where there is more than one path from the "root object" to any other given object are an open research question.
16:55 <vilu> dmwit: Ok, can you point me to any papers?
16:55 mnoonan joined
16:55 dogweath_ joined
16:55 <vilu> Either way I think that means I'm in over my head.
16:55 <dmwit> You want papers on an open research question? "Open research question" means nobody knows how to do it. So no. I can't point you to any papers telling how to do something nobody knows how to do.
16:56 <vilu> Misunderstood what you meant.
16:56 <vilu> Thanks either way.
16:57 <alexad> anyone used scotty much know if there's a nice way to separate and namespace out groupings of actions?
16:59 conal joined
17:00 hph^ joined
17:00 zdenal joined
17:01 edmundnoble joined
17:01 xtreak joined
17:01 diwo joined
17:01 ozzymcduff joined
17:01 jkachmar joined
17:02 nnplv joined
17:03 Mutter joined
17:03 lastmanstanding joined
17:03 Myk267 joined
17:04 zdenal joined
17:04 errst joined
17:05 knupfer joined
17:08 codesoup joined
17:09 markus1189 joined
17:12 enterprisey joined
17:13 <[exa]> vilu: zippers don't work very easily for structures that you can't easily cut in _disconnected_ pieces
17:13 tzemanovic joined
17:13 elfets joined
17:13 enterprisey joined
17:13 FreeBirdLjj joined
17:15 Deide joined
17:15 Akii joined
17:17 bergey joined
17:18 amar_ joined
17:18 doomrobo joined
17:18 doomrobo joined
17:19 <doomrobo> is there a way to export something with a different identifier? For example, I would like to re-export Criterion.bgroup as benchGroup
17:19 <geekosaur> rebind it in your module, export that.
17:19 <cocreature> doomrobo: no or at least not short of defining "benchGroup = bgroup"
17:19 amar_ joined
17:19 remyhr joined
17:20 <doomrobo> yeah, I wanted to avoid rebinding, just for the sake of consistency. Everything else is re-exported
17:20 <doomrobo> I'll just use bgroup instead. Thanks!
17:21 skeuomorf left
17:21 mizu_no_oto joined
17:22 lainon joined
17:22 hphuoc25 joined
17:22 tsaka__ joined
17:23 Luke joined
17:26 hphuoc25 joined
17:26 pranz4 joined
17:26 Akii joined
17:27 gienah_ joined
17:28 iAmerikan joined
17:28 osa1_ joined
17:29 amar_ joined
17:31 hphuoc25 joined
17:32 ahihi joined
17:32 ski joined
17:33 camsbury joined
17:34 <dmwit> [exa]: I dunno. Disconnected seems easy enough, since the zipper can just have one "position" per piece.
17:34 fmixing joined
17:34 preyalone joined
17:35 danso joined
17:36 prg318 joined
17:36 <quicksilver> I think [exa] means that if your zipper is at a 3-fork but there aren't data types already for the data in those 3 pieces, you're doing to need to write those data types too
17:36 Jeanne-Kamikaze joined
17:37 mreh joined
17:37 <quicksilver> certainly the time I wrote a zipper for a custom mutually recursive group of ADTs I had a lot of "part types" to write
17:38 zdenal joined
17:39 bilal80 joined
17:39 UnChallengeD joined
17:40 <[exa]> there could be something like makeLenses that automatically does the term differentiation for zippers
17:40 keepLearning512 joined
17:40 bwe joined
17:41 <dmwit> I'd be shocked if one of the existing zipper libraries doesn't have that already.
17:42 <dmwit> But it doesn't help if your data type also has invariants not expressed by Haskell's concept of algebraic types -- as e.g. `Map` or `Graph` do.
17:42 iAmerikan joined
17:43 DSM joined
17:43 ubvnoxn joined
17:44 <maerwald> I thought stack builds shouldn't fail
17:45 <maerwald> first I get resolver errors, then build failures :>
17:45 <quicksilver> [exa]: I'm sure I saw an implementation of that, yes.
17:45 <quicksilver> but it felt clumsy
17:45 rprije joined
17:45 detrumi joined
17:45 <quicksilver> I guess partly because when you can re-use existing data types you'd like to
17:46 <quicksilver> (like re-using lists in the list zipper)
17:46 keepLearning512 joined
17:46 fmixing joined
17:47 connrs joined
17:48 amirpro joined
17:49 Vulfe joined
17:49 fmixing joined
17:50 Destol joined
17:50 desperek joined
17:51 mreh joined
17:51 keepLearning512 joined
17:51 amirpro joined
17:51 altjsus joined
17:52 <[exa]> quicksilver: wow, cool, thanks. I'll try to find it
17:53 language_agnosti joined
17:54 vukasink joined
17:55 abhiroop joined
17:56 mizu_no_oto_work joined
17:56 pranz joined
17:56 cybai joined
17:57 sakalli_ joined
17:57 gchristensen joined
17:58 darjeeling_ joined
17:58 Ariakenom joined
17:58 gchristensen left
17:59 bahamas joined
17:59 <quicksilver> [exa]: there is also edwardk's implementation which I don't understand https://github.com/ekmett/zippers
17:59 scottschmidt1 joined
17:59 <quicksilver> check out the examples.
17:59 al-damiri joined
18:01 pranz1 joined
18:01 codesoup joined
18:03 enterprisey joined
18:03 andyhoang joined
18:03 emilypi joined
18:04 amar__ joined
18:04 tombusby joined
18:04 replay joined
18:05 <[exa]> quicksilver: ok that one is extremely cool ◔.◔
18:06 twandy joined
18:07 <shapr> I got much more comfortable doing webdev in Haskell this past weekend
18:07 <johnw> yay!
18:07 <shapr> I should write a blog post about going from html page mockup to all the things
18:07 <johnw> what did you write?
18:07 <shapr> cocreature found html-to-lucid, so I used that for some html page mockups
18:07 rprije joined
18:08 <shapr> and persistent for datatypes, I switched to scotty from Spock, looks like uploaded files is broken for Spock
18:08 <shapr> it was fun
18:08 kapil___ joined
18:08 <[exa]> OTOH if you imagine zipper as a container for the real structure or for the finger element, lenses and traversals make quite a lot of sense
18:09 DSM joined
18:09 sakalli_ joined
18:11 dpyro joined
18:12 pally joined
18:13 fendor_ joined
18:15 diwo joined
18:15 conal joined
18:16 rzp joined
18:16 <pally> > :t "Hello"
18:17 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
18:17 buck_ joined
18:17 <monochrom> Omit the leading "> " when using :t
18:17 <pally> :t "Hello"
18:17 <lambdabot> [Char]
18:18 conal_ joined
18:19 ozzymcduff joined
18:19 <pally> Then how is [Char] different to [String] ?
18:20 <monochrom> String = [Char], therefore [String] = [[Char]]
18:20 <monochrom> Therefore [Char] ≠ [[Char]]
18:20 twandy joined
18:20 <pally> ah... icic. Thanks
18:21 <monochrom> The power of doing algebra and logic and be liberated from mushy intution.
18:22 <dstolfa> monochrom: intuition is often wrong :>
18:22 <johnw> hence him calling it mushy :)
18:23 pranz2 joined
18:23 <monochrom> The homework I gave to my students rewards those who use algebra and logic, and punishes those who use intuition.
18:23 paidnode joined
18:24 <dstolfa> monochrom: ah yes, i love that kind of homework
18:24 <dstolfa> monochrom: i did it a few times as well in hoare logic, where i asked them if {X = x & Y = y & x = y} C {x != y} can ever be true
18:24 <dstolfa> some said yes :)
18:24 <dstolfa> others were wrong and said no
18:25 <dstolfa> the former used the definitions, the latter used intuition
18:25 <monochrom> I put this on homework: Express scanr as a foldr. I began the question by the very misleading "for example scanr (-) z [a,b,c,d] = [foldr (-) z [a,b,c], foldr (-) z [b,c], foldr (-) z [c], foldr (-) z []]
18:26 <monochrom> So those who use intuition would stare at that example and get very stuck. This looks like multiple foldr's, not just one.
18:26 pera joined
18:26 raingloom joined
18:27 <dstolfa> monochrom: i take it that this is a FP course?
18:27 <monochrom> The correct thing to do is what I taught them: Start at the code of scanr (I gave it to them) and recognize or calculate that it fits the foldr pattern.
18:27 <monochrom> @src scanr
18:27 <lambdabot> scanr _ q0 [] = [q0]
18:27 <lambdabot> scanr f q0 (x:xs) = f x q : qs
18:27 <lambdabot> where qs@(q:_) = scanr f q0 xs
18:27 <monochrom> Kind of. It's one of those "principles of programming languages" course and I'm doing FP at this point.
18:28 <dstolfa> monochrom: aah right, we have one of those too in the first year but it's in ML, not haskell
18:28 <dstolfa> i don't know why
18:28 emilypi joined
18:28 <dstolfa> this is not bashing on ML, i just legitimately don't know why ML was chosen
18:28 UnChallengeD joined
18:29 <monochrom> Sometimes it's better to begin with eager evaluation. I did Racket before Haskell because of that.
18:29 <monochrom> And some other times ML simply has a real module system worth knowing.
18:29 <dstolfa> monochrom: i agree, but it isn't really a course that focuses on strictness, it just kind of looks at some foundations of compsci and exemplifies with ML
18:29 <dstolfa> though it does have "lazy lists" as an example
18:30 <monochrom> And some other times it could be just because the instructor worships Bob Harper :)
18:30 <dstolfa> monochrom: it might just be a personal preference, it's not like there's a big difference in terms of that course
18:30 <geekosaur> monochrom, except for those of us whose intuition notices a pattern, and that that pattern can be abstracted
18:30 <dstolfa> monochrom: well, his PhD advisor was rod burstall along with robin milner, that may have something to do with it ;)
18:31 <monochrom> I am beginning to think maybe next time I'll use OCaml. Because then I could also talk about OOP done right.
18:32 <monochrom> Also next time I may introduce Backpack. (I might not have time to prepare for it this term.)
18:32 lortabac_ joined
18:32 <monochrom> Whereas ML has a real module system, Backpack has a real package system :D
18:32 <dstolfa> monochrom: OCaml is nice though its standard lib is a bit questionable. i know lots of people who speak very fondly of OCaml though
18:33 Patternmaster joined
18:33 <monochrom> (So I guess "real" = paramtrizable composable etc etc!)
18:33 lykrysh joined
18:33 <monochrom> OCaml exposes what classes and objects really mean.
18:34 <monochrom> Well, I guess Python does a bit of that too. Basically making the "self" explicit.
18:34 lainon joined
18:35 bahamas joined
18:35 glittershark joined
18:36 pranz3 joined
18:36 <glguy> monochrom: Did you take off points if they got the strictness wrong?
18:37 <monochrom> No.
18:37 <monochrom> Actually I haven't even starting the marking :D
18:37 Destol joined
18:37 pranz4 joined
18:38 <monochrom> But no, not planning to pick on strictness because I hadn't taught them that at the time (but I did recently) and all I wanted is for them to look at what @src said above and saw the foldr inside it.
18:39 crobbins joined
18:39 <monochrom> But I do think "foldr (\x r -> f x (head r) : r) [q0]" has the exact same strictness/non-strictness as the direct recursion version.
18:40 <glguy> yeah, if they use head, but if they use the pattern match found in @src 's where clause in their lambda it's different
18:40 <monochrom> Oh! Right, yeah, I won't pick on that.
18:41 sdothum_ joined
18:41 <monochrom> Yeah I now recall I saw some student doing that. It'll be OK.
18:41 pranz joined
18:42 <dstolfa> monochrom: yeah being picky about strictness is probably out of scope here if you didn't explicitly teach them that or mention to be careful about it
18:42 <monochrom> I hadn't brought up lazy evaluation when the homework was given. They were still assuming eager evaluation in Haskell! And they hadn't thought of testing it.
18:43 <glguy> I wasn't serious about picking on strictness, but I figured that in the translation some of the solutions would change it
18:43 <glguy> Haskell makes stuff like that quite tricky
18:43 <monochrom> So one day when I showed them "doITermniate = take 2 (foo 0) where foo n = n : foo (n+1)" it broke their minds. :)
18:43 codesoup joined
18:44 <dstolfa> monochrom: it's one of those fun moments when students realise something they've been told all their life is not always true :)
18:44 <dstolfa> monochrom: kind of like using isomorphisms instead of equality :)
18:45 language_agnosti joined
18:45 <maerwald> most of what students are told is not true, but the current academic narrative
18:46 <dstolfa> maerwald: ah but see, i always emphasise that it's the model we're working with now and that coming up with different models is perfectly acceptable and in fact encouraged if justified :)
18:46 <dstolfa> teaching things as "facts" is very silly IMO
18:46 <maerwald> teaching is silly
18:46 <monochrom> maerwald it is not just academia. What dstolfa said. What is "truth" anyway? Do you have it?
18:46 <maerwald> learning is better
18:47 seveg joined
18:47 <dstolfa> maerwald: learning is good, but having someone to guide you in learning is always helpful. this is where you can leverage people with experience to make your learning experience better and possibly get feedback on your ideas
18:47 <maerwald> dstolfa: exactly, but I consider that guidance, not teaching :)
18:48 <dstolfa> maerwald: fair enough, s/teaching/guidance/ in the above :)
18:48 <monochrom> learn = self-teach so if teaching is silly then learning is self-silly.
18:48 pranz1 joined
18:48 <rotaerk> ...
18:49 <shapr> maerwald: 'lies for teaching' are useful, and I'm always explicit about that.
18:49 <monochrom> But OK I get paid for teaching so you could argue that I'm just defending a self-interest.
18:49 dogweather joined
18:49 <maerwald> sounds sad
18:50 <maerwald> I also did that once and I realized it doesn't work
18:50 <maerwald> teaching people is very frustrating too
18:50 <dstolfa> monochrom: when i "teach" i basically get paid to ask students tricky questions and guide their discussion when they wander off
18:50 <shapr> I'm always explicit about 'lies for teaching' being a derivative of the reality underneath.
18:50 <maerwald> so it's better to not teach at all
18:50 <shapr> I disagree
18:50 <dstolfa> maerwald: i think it heavily depends on the way people are being taught (or guided if you will)
18:51 <maerwald> shapr: I might also be wrong, what do I know about other people :>
18:51 <shapr> My mother specifically requests the simpler glossier version, nowadays she says "Why did my internet break? and don't start with the sabertooth tiger this time!"
18:51 <shapr> maerwald: I don't know
18:51 <maerwald> everyone just projects anyway
18:51 <maerwald> (or not)
18:51 <shapr> heh
18:51 errst_ joined
18:51 <monochrom> Yeah I think if you haven't been to one of my classes you shouldn't claim across-the-board that my teaching doesn't work.
18:51 pranz2 joined
18:51 __monty__ joined
18:52 <glguy> monochrom: Where do we sign up?
18:52 <monochrom> You have to come to Toronto!
18:52 <dstolfa> the way i see it, teaching people existing material in such a way that they gain insight from it is crucial. teaching things as "facts" and expecting them to accept the current world order is silly and frankly misleading
18:52 <maerwald> monochrom: that's not a compelling argument
18:52 <maerwald> but I wasn't that specific anyway
18:52 <pdxleif> @hoogle Applicative f =>
18:52 <lambdabot> Protolude pass :: Applicative f => f ()
18:52 <lambdabot> Control.Invertible.Monoidal unitDefault :: Applicative f => f ()
18:52 <lambdabot> Control.Monad.Extra obvious :: Applicative f => f ()
18:53 Linter joined
18:53 pranz3 joined
18:53 <pdxleif> @hoogle Applicative f => (a -> f (Maybe ab)) -> Maybe a -> f (Maybe b)
18:53 <lambdabot> Network.AWS.Prelude may :: Applicative f => ([a] -> f b) -> [a] -> f (Maybe b)
18:53 <lambdabot> Data.List.Index ifor :: Applicative m => [a] -> (Int -> a -> m b) -> m [b]
18:53 <lambdabot> Data.List.Index itraverse :: Applicative m => (Int -> a -> m b) -> [a] -> m [b]
18:53 <dstolfa> for example, teaching someone a topic that's the current world order and emphasising the ideas it captures, but pointing out its flaws is good. teaching it as a fact is bad
18:54 <maerwald> talking about teaching/learning is probably similarly difficult like talking about what the right political system is. People have pre-set ideas about it and it's hard to get to a really open discussion
18:54 dbmikus joined
18:54 <monochrom> Yeah so why don't you drop it and never start it again?
18:54 sakalli_ joined
18:55 <maerwald> what do you mean? Avoiding hard discussions?
18:55 beauby joined
18:55 <monochrom> It's like the 10th time you teach us how and why teaching is silly.
18:55 vlatkoB joined
18:55 <maerwald> not really
18:55 <monochrom> Avoid pointless discussions.
18:55 <monochrom> @quote monochrom pointless.de
18:55 <lambdabot> monochrom says: All pointless debates can be settled by going polymorphic.
18:55 <maerwald> I don't think it's pointless at all
18:56 <dminuoso> monochrom: self quoting should be punished by requiring you to bake and send us all cookies.
18:56 <shapr> browser cookies?
18:56 <dstolfa> i like cookies
18:56 <dstolfa> i agree with dminuoso
18:56 mariatsji joined
18:56 <dstolfa> monochrom: make cookies!
18:56 zachk joined
18:56 zachk joined
18:57 <monochrom> Darn...
18:57 <shapr> I like programming, and I really like programming in Haskell
18:57 kritzefitz joined
18:57 <maerwald> people with high ego tend to quote themselves :P
18:57 <shapr> what's wrong with high ego?
18:57 <maerwald> nothing
18:57 Jeanne-Kamikaze[ joined
18:57 <shapr> oh ok,
18:57 <monochrom> (Last off-topic remark) High ego is how I overcome stage fright.
18:59 <dstolfa> monochrom: of teaching? :))
18:59 <monochrom> Yeah! How else could I survive?
18:59 <dstolfa> monochrom: do you teach them how to overcome stage fright in order to teach?
18:59 <dstolfa> monochrom: or do you teach them how to teach on how to overcome stage fright in order to teach?
18:59 dbmikus_ joined
18:59 <dstolfa> monochrom: or ...
19:00 <maerwald> ...just don't teach at all :>
19:00 <dstolfa> monochrom: it's an infinity groupoid that may or may not be isomorphic to burrito origami
19:01 mszczygiel joined
19:01 <monochrom> I talked myself into become an egomaniac so that I overcame stage fright for all public-speech occasions including teaching but that's really a side-effect my main goal was the PhD oral exam I had to go through!
19:01 <maerwald> great
19:01 <maerwald> I really don't know how I made stack fail both resolution and build
19:01 <maerwald> I thought it's supposed to be the opposite
19:01 <monochrom> But maerwald is going to chastise us too on how the whole PhD thing is silly too.
19:02 <electrocat> monochrom: lol
19:02 <maerwald> monochrom: I have literally never said such a thing
19:02 <dstolfa> maerwald: it's because it's written in this weird unsafe language called haskell
19:02 <monochrom> Anyway obTopic I have recently worked out how to teach type inference.
19:02 <dstolfa> monochrom: make them write a type checker in agda
19:02 <maerwald> but by now I'm used to people putting words into my mouth ;)
19:02 <monochrom> Oh type-checking Adga is actually easier.
19:03 <dstolfa> monochrom: not if you don't teach them agda and don't specify what you mean by "type checking" :)
19:03 <maerwald> https://github.com/neovimhaskell/nvim-hs/issues/65 just wanted to configure my vim in haskell :/
19:04 Jeanne-Kamikaze joined
19:04 bornjre joined
19:04 andyhoang joined
19:04 <__monty__> Had a project writing a typechecker for dependent lambda calculus in scala, did not enjoy it. Spent 90% of the time struggling with scala.
19:04 <electrocat> monochrom: now i'm curious
19:04 acarrico joined
19:05 <monochrom> But what I figured out is not new. More accurately, I figured out that I should follow "algorithm I" in the Milner paper, i.e., allow unification to update and use a mutable table of substitutions.
19:05 <monochrom> Because the alternative would be to always rewriting your type environment every other second and it becomes a chore.
19:06 <__monty__> maerwald: Just moving .stack out of the way for a few minutes wouldn't hurt, would it?
19:06 <maerwald> it's global state, other parts of my editor might be using it
19:06 <dstolfa> monochrom: are you aware of fitch notation?
19:06 language_agnosti joined
19:07 <maerwald> also, that sounds very much like a "windows" solution
19:07 <monochrom> __monty__: Take consolence in knowing that https://www.umsu.de/logik/trees/ is written in javascript. >:)
19:07 <__monty__> maerwald: Afaics saep is asking you this to debug the problem. Not as a solution.
19:07 <monochrom> dstolfa: No.
19:08 valentinbuza joined
19:08 <monochrom> Oh that's kind of neat.
19:08 <dstolfa> monochrom: you should look it up, it makes type inference much easier to read
19:10 <monochrom> OTOH I know of something even better: structured derivation of Ralph Back. https://en.wikipedia.org/wiki/Structured_derivations
19:10 megaTherion joined
19:11 <maerwald> it also makes me kinda nervous downloading my compiler binary from a random website (not even shown from where). Also feels "windows" like
19:11 <monochrom> If you say "it seems to generalize Fitch to cover equational reasoning too" that's about right.
19:11 <__monty__> maerwald: Well you chose to use stack...
19:12 <maerwald> __monty__: no, the project says to
19:12 <maerwald> and some projects are already kinda broken without stack
19:12 DSM joined
19:13 <monochrom> What I have now is http://www.cs.utoronto.ca/~trebla/CSCC24-2018-Summer/type-inference.txt which is indented like Fitch's and SD, I just don't have the vertical lines etc.
19:13 <maerwald> I still don't use it for development, only for installing tools
19:13 mariatsji joined
19:13 dogweather joined
19:14 pipahask joined
19:14 language_agnosti joined
19:16 language_agnosti joined
19:19 <shapr> maerwald: how would you improve it?
19:19 <maerwald> shapr: improve what?
19:20 <shapr> stack and the ecosystem?
19:20 <maerwald> remove stack, make hackage not a randomly rolling release platform, but have a system to test reverse dependencies automatically and remove that PvP madness
19:20 <__monty__> By using nix ; >
19:20 <maerwald> but that's not my call
19:21 <shapr> maerwald: have you tried nix?
19:21 <maerwald> also, fix GHC ABI breakage, but that's beyond my knowledge :>
19:21 <maerwald> yes, awful
19:21 drets_ joined
19:21 <shapr> hm, I like it so far
19:21 conal joined
19:21 <maerwald> second worst distro I've tried so far
19:21 <rotaerk> nix is the best option available, I think, but it's complicated
19:21 <__monty__> You don't have to run nixos to use nix.
19:21 <yushyin> maerwald: that would be great
19:22 <maerwald> __monty__: that's a common misconception. You do run nixpkgs, which are part of NixOS
19:22 <maerwald> whether you "boot" it or not
19:22 <rotaerk> NixOS uses nixpkgs but nixpkgs isn't tied to NixOS
19:22 <rotaerk> I love NixOS though
19:22 <maerwald> that's wrong
19:23 <__monty__> And you don't *have* to use nixpkgs.
19:23 <shapr> maerwald: what's wrong?
19:23 <__monty__> Don't see why you wouldn't though.
19:23 <maerwald> shapr: that nixpkgs is not tied to NixOS
19:23 <rotaerk> why do you say that it is?
19:23 <maerwald> https://github.com/NixOS/nixpkgs
19:23 <shapr> er, but I can use nix the package manager without installing nixos
19:23 <maerwald> shapr: no
19:24 <shapr> er, yes?
19:24 <maerwald> shapr: you don't *boot* it
19:24 <maerwald> but you use parts of NixOS
19:24 <shapr> yeah?
19:24 <maerwald> yes
19:24 <shapr> but part is not all
19:24 <maerwald> yes
19:24 <__monty__> Sounds pedantic.
19:24 <shapr> that's what I said
19:24 iAmerikan joined
19:24 <maerwald> __monty__: not at all. The configuration complexity is a distro decision and is what makes nixpkgs so bad
19:24 <rotaerk> you can use nixpkgs in non-NixOS distros
19:24 <maerwald> I am aware
19:25 <maerwald> you can also create random chroots on any distro for any other distro :>
19:25 <shapr> uhh
19:25 <maerwald> doesn't mean the distro you run in a chroot is not said distro
19:25 <shapr> I think there's a vocabulary problem here.
19:25 <maerwald> not at all
19:25 <shapr> sure man, if you say so
19:26 <maerwald> nixpkgs need to be configured, they are not standalone, they are part of a release and design process
19:26 <maerwald> it's not like throwing .debs out there (and even they have a configuration context)
19:27 <maerwald> that is what the distro does
19:27 <shapr> so I did a bunch of Haskell webdev this past week, it's been great fun
19:27 <shapr> I learned about html-to-blaze and html-to-lucid
19:27 <shapr> they're pretty cool
19:27 <shapr> I used to do a bunch of html mockup -> 'real' website
19:27 <shapr> but this is the first time I've done it in Haskell
19:28 language_agnosti joined
19:28 <shapr> learned how to put unique constraints on a persistent db
19:29 <shapr> now that I've done stuff with persistent, what are other good type <-> db libraries to try?
19:29 lumm joined
19:30 <monochrom> GHC ABI breakage is not going to be fixed because no one wants to turn off optimizations.
19:30 <monochrom> Hugs doesn't have these problems in the first place. The bliss of using an interpreter.
19:30 <maerwald> Yeah, and it's probably not easy either way. But it's the reason dynamic linking sucks, which is another reason people come up with PvP or semantic versioning, which is the reason people stop caring about breaking *API*, which is the reason of an overly complicated dependency graph, which is the reason...
19:31 <maerwald> ...of the tool mess :>
19:31 survove joined
19:31 <shapr> I like building websites in Haskell
19:31 <dstolfa> maerwald: dynamic linking sucks for many reasons. this is just one reason :>
19:31 <maerwald> yeah
19:32 <maerwald> what I find interesting is... in ecosystem/languages where the build tools are fundamentally broken, people tend to be very careful about API breakage :>
19:32 <maerwald> because otherwise everything is broken
19:33 sheyll joined
19:33 <maerwald> now that we have stack, we can just keep breaking API and not care!
19:33 <dstolfa> maerwald: except when stack doesn't want to work because lib A depends on lib B version 1.0 and lib C depends on lib B verison 1.1
19:33 <maerwald> I'm a bit sarcastic, but only a bit...
19:33 <dstolfa> version*
19:33 <__monty__> shapr: Most type heavy db interface is probably opaleye-sot (sugar on top) which I think was renamed to "Tisch"?
19:34 <monochrom> Use the waterfall model to eliminate API breakage altogether, right at the root cause.
19:34 fishythefish joined
19:34 <maerwald> lol
19:34 <ystael> shapr: We moved from Persistent/Esqueleto to Opaleye over the past year because we were unhappy with the limits Persistent/Esqueleto imposed on the queries we could phrase. We wrote a Template Haskell library to control some of the boilerplate, which I think we're going to open source when we have cycles to do so.
19:35 <maerwald> ystael: cool, is there a blog post about that?
19:35 <maerwald> (consider that also advertisement for your company!)
19:35 iAmerikan joined
19:35 <ystael> not yet :| (and yes, we know we need to get it out there for that as well as public service reasons)
19:35 <__monty__> ystael: My understanding was esqueleto got in the way less not more could you give some examples?
19:36 <ystael> __monty__: I don't have a detailed example easily accessible of what pushed us in that direction, sorry. We wanted to write some icky joins and they were worse in Esqueleto than in Opaleye.
19:37 <__monty__> Hmm, isn't joins a common critique of opaleye? (Something about subselects?)
19:37 <ystael> Dan Fithian, the developer who did most of the work on this feature, gave a talk on some related work at LambdaConf a couple weeks ago, but Opaleye wasn't the primary focus.
19:38 p0lyph3m joined
19:40 <ubvnoxn> Is there a way to avoid a [-Wmissing-methods] warning when I know its ok not having a method implementation, without disabling the warning?
19:41 _janne joined
19:41 <geekosaur> method = undefined?
19:41 <ubvnoxn> (I'm coding a A TypeError instance)
19:41 <geekosaur> (or = error "don't do that", etc.)
19:41 <byorgey> ubvnoxn: method = error "This method is unpossible" ?
19:42 <byorgey> I do stuff like that sometimes, e.g. when making a Num instance for which stuff like abs and signum don't make sense
19:42 jao joined
19:42 <ubvnoxn> yep, and with an indexed type?
19:43 gurmble joined
19:43 <ubvnoxn> That was actually my problem, my bad for the sloppy question. My code is something like
19:43 <ubvnoxn> > class HasFieldRec (l::k) (r :: [(k,Type)]) where
19:43 <ubvnoxn> > type LookupByLabelRec l r :: Type
19:43 <ubvnoxn> > hLookupByLabelRec:: Label l -> Record r -> LookupByLabelRec l r
19:43 <lambdabot> error:
19:43 <lambdabot> Not in scope: type constructor or class ‘Label’error:
19:43 <lambdabot> Not in scope: type constructor or class ‘Record’error:
19:43 <lambdabot> <hint>:1:1: error: parse error on input ‘class’
19:43 <lambdabot> <hint>:1:1: error: parse error on input ‘type’
19:44 supp1 joined
19:44 <ubvnoxn> So in the typeerror instance I can put bottom in the function, but in the type?
19:45 <cocreature> ubvnoxn: TypeError?
19:45 <ubvnoxn> from GHC.TypeLits
19:45 <cocreature> eh ErrorMessage, sry mixed up the types
19:45 <cocreature> no I mean use that as the type
19:45 <cocreature> type LookupByLabelRec l r = TypeError (Text "impossible")
19:46 dpyro joined
19:47 dogweather joined
19:47 <ubvnoxn> Nice
19:48 <ubvnoxn> I was putting a nonsense value, but I knew there must be a better way
19:48 _ashbreeze_ joined
19:51 survove joined
19:52 <shapr> ystael, __monty__ : thanks, I'll try opaleye next
19:52 pfurla joined
19:52 conal joined
19:53 tzemanovic joined
19:54 davr0s joined
19:56 <ubvnoxn> thank you!
19:57 <__monty__> shapr: Just to be clear Tisch, formerly known as opaleye-sot, is something that builds on top of opaleye, taking its design further.
19:58 __bo joined
19:59 fizbin1 joined
20:01 mariatsji joined
20:03 zariuq joined
20:03 ImRatedX joined
20:03 <* hackage> ztar 0.0.1 - Creating and extracting compressed tar archives http://hackage.haskell.org/package/ztar-0.0.1 (brandonchinn178)
20:05 dogweather joined
20:06 detrumi left
20:08 darjeeling_ joined
20:10 catern joined
20:11 Luke joined
20:12 diwo joined
20:12 dented42 joined
20:14 pera joined
20:19 _ joined
20:19 alx741 joined
20:20 patlv joined
20:22 dogweather joined
20:22 <Zemyla> What do p_o files do?
20:23 <electrocat> Zemyla: i believe they are compiled .hs files instrumented with profiling stuff
20:23 chaosmasttter joined
20:23 cloudhead joined
20:24 ImRatedX left
20:24 twanvl joined
20:24 raingloom joined
20:27 <Ariakenom> newLock = do {t <- new TChan; forkIO (forever . join . atomically . getTChan $ t); return t}
20:27 <geekosaur> right, it's a .o file from a build with profiling enabled. which requires profiling support to be linked in, so itss distinct from normal .o
20:27 <Ariakenom> withLock t io = putTChan t io
20:28 RegEchse joined
20:29 Vulfe joined
20:29 <shapr> __monty__: sounds good to me, I'll try both
20:30 <hodapp> o hai shapr!
20:30 lambda-11235 joined
20:30 <shapr> hi hodapp !
20:30 <hodapp> how's it going?
20:31 pally joined
20:31 <int-e> Ariakenom: that's not nice... withLock is asynchronous; execution happens in the wrong Haskell thread; results are not returned... and why do you hate MVars?
20:32 <shapr> hodapp: pretty good, wrote a bunch of Haskell this past week
20:33 <* hackage> ztar 0.0.2 - Creating and extracting compressed tar archives http://hackage.haskell.org/package/ztar-0.0.2 (brandonchinn178)
20:34 andyhoang joined
20:34 replay joined
20:34 DSM joined
20:34 codesoup joined
20:35 <hodapp> shapr: what sorta Haskell?
20:35 <shapr> webdev stuff
20:35 <hodapp> I need to revive https://github.com/hodapp87/contextual and add some 3D support to it
20:35 <hodapp> and maybe get it in Hackage
20:36 <shapr> I think files uploaded from a webform is broken in Spock, so I switched to scotty
20:36 <hodapp> huh
20:36 <shapr> had some web page mockups, and use html-from-lucid to convert those
20:36 <shapr> and persistent-sqlite with persistent-th
20:36 <Ariakenom> int-e: :) Just came to think of how to do MVars with STM. Not even sure I've ever wondered. :p
20:36 <hodapp> all my webdev stuff has been in Go & Bootstrap lately
20:36 mreh joined
20:37 <hodapp> but at least I can translate some of the Bootstrap know-how to Hakyll
20:38 <Ariakenom> int-e: withMVar (a,b) io = atomically (put a io) >> atomically (get TChan b io)
20:39 seveg joined
20:40 pranz4 joined
20:40 eruditass joined
20:40 <pally> I want to represent a graph using a list of pairs (city, [city, dest]) but [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])] is not allowed
20:40 <Ariakenom> take (a,b) = atomically $ get a; drop (a,b) = atomically $ put b ();
20:41 <pally> suggestions?
20:42 <hodapp> pally: err, why's it now allowed?
20:42 <rotaerk> pally, your syntax is backwards
20:42 <rotaerk> or just wrong, rather
20:42 <rotaerk> :t [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])]
20:42 <lambdabot> [([Char], [[Char]])]
20:42 <pally> hodapp, it's allowed? I'll try again
20:42 <hodapp> sorry, meant "not", not "now"
20:43 amiri joined
20:43 <rotaerk> so your list's type is [(String, [String])]
20:44 lainon joined
20:44 <int-e> > [("New York", ["Kansas", "Dallas", "Toronto"]),("Montreal", ["Calgary", "Detroit"])] >>= sequenceA -- intuitive?
20:44 <lambdabot> [("New York","Kansas"),("New York","Dallas"),("New York","Toronto"),("Montre...
20:45 amar joined
20:46 conal joined
20:46 <int-e> :t foldMap sequenceA
20:46 <lambdabot> (Foldable t2, Applicative f, Traversable t1, Monoid (f (t1 a))) => t2 (t1 (f a)) -> f (t1 a)
20:46 remyhr joined
20:47 <pally> > head [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])]
20:47 <lambdabot> ("New York",["Kansas","Dallas","Toronto"])
20:47 <pally> >head head [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])]
20:47 <pally> > head head [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])]
20:47 <lambdabot> error:
20:47 <lambdabot> • Couldn't match expected type ‘[[([Char], [[Char]])] -> t]’
20:47 <lambdabot> with actual type ‘[a0] -> a0’
20:48 <geekosaur> you need parens
20:48 <pally> I want the grab the adjacency list of vertex "New York"
20:48 <pally> > last (head [ ("New York", ["Kansas", "Dallas", "Toronto"]), ("Montreal", ["Calgary", "Detroit"])])
20:48 <geekosaur> 'head head' means applying the function head to the function head, not applying it twoce
20:48 <lambdabot> error:
20:48 <lambdabot> • Couldn't match expected type ‘[a]’
20:48 <lambdabot> with actual type ‘([Char], [[Char]])’
20:49 dogweather joined
20:49 <geekosaur> it's a tuple; snd, not last
20:50 conal joined
20:52 epsilonhalbe joined
20:52 <pally> geekosaur, what if I have an n-tuple? how do I get i-th?
20:53 knupfer joined
20:53 epsilonhalbe left
20:54 brocoli joined
20:55 <geekosaur> tuples aren't iterables; you define your own
20:55 <__monty__> pally: Prelude doesn't go past septuples I think.
20:55 <geekosaur> (there are ways to do it, mostly ugly or painful in one way or another. if you intend a list, use a list)
20:55 DigitalKiwi joined
20:55 <geekosaur> __monty__, 15 for some things, 6 for others
20:55 <geekosaur> 63 is the max if you don't need typeclass instances for them
20:56 osa1 joined
20:58 <__monty__> geekosaur: Hmm, good to know, doubt I'll ever need the knowledge though : )
20:59 language_agnosti joined
20:59 <geekosaur> it could in theory be higher but the runtime used to dump core on larger tuples. don't think anyone has tested recently though
20:59 DSM joined
20:59 lumm joined
21:02 __bo joined
21:02 <pally> I am looking through http://hackage.haskell.org/package/base-4.11.1.0/docs/Data-List.html but can't find a function that allows me to grab the i-th element of a list
21:03 <ddellacosta> pally: (!!) is what you want although it's not efficient
21:03 <ddellacosta> http://hackage.haskell.org/package/base-4.11.1.0/docs/Prelude.html#v:-33--33-
21:03 aarvar joined
21:03 <ddellacosta> > [1,2,3] !! 2
21:03 <lambdabot> 3
21:04 <rotaerk> > [1,2,3] !! (-1)
21:04 <lambdabot> *Exception: Prelude.!!: negative index
21:04 <ddellacosta> ...and yeah, it's partial
21:04 codesoup joined
21:04 pranz joined
21:04 <dmwit> pally: Generally: don't want that. =P
21:05 <infinisil> It can't really be efficient can't it
21:05 <ddellacosta> yeah, if you find yourself doing that a lot you probably want Vector or something
21:05 <rotaerk> I use it when I'm feeling too lazy to switch to arrays, until I have reason to optimize it
21:05 <geekosaur> Lists are best thought of as loops encoded as data; if you want positional indexing, consider Vector
21:06 darjeeling_ joined
21:06 iAmerikan joined
21:06 bendo joined
21:07 <pally> geekosaur, thanks :-)
21:07 <pally> rotaerk, Data.Array is immutable, I need to add and remove items to/from the collection
21:07 <monochrom> Or you should still use list but you rethink your algorithm, e.g., [f (xs !! i) | i <- [0.. length xs]] is some people's first instinct but [f x | x<-xs] and (map f xs) are simpler and more direct and less XY problem.
21:08 <ddellacosta> pally: you can certainly add/remove items from an immutable collection depending on how you structure your algorithm. If you really need something mutable though, there are mutable Vectors
21:09 striapach joined
21:09 <ddellacosta> https://hackage.haskell.org/package/vector-0.12.0.1/docs/Data-Vector.html#g:38
21:10 raynold joined
21:11 XorSwap joined
21:11 <pally> how is [f x | x<-xs] gonna get me the ith item from xs?
21:11 <pally> that's list comprehension, right?
21:11 pranz1 joined
21:12 danso joined
21:13 <monochrom> I didn't say it would.
21:14 Jeanne-Kamikaze joined
21:14 <monochrom> I said the other way round: some people thought that getting the ith item from xs was necessary to compute map f xs.
21:14 XorSwap joined
21:15 Arcaelyx joined
21:16 DSM joined
21:16 dented42 joined
21:19 <* hackage> containers-verified 0.6.0.1 - Formally verified drop-in replacement of containers http://hackage.haskell.org/package/containers-verified-0.6.0.1 (JoachimBreitner)
21:20 <monochrom> w00t formally verified
21:21 <johnw> monochrom: and a paper to go with it too :)
21:21 <monochrom> yikes
21:21 pranz2 joined
21:21 <hodapp> oooh...
21:22 <__monty__> Any super impressive side benefits, like it's twice as space efficient now?
21:22 Linter joined
21:23 <monochrom> No, I think it's just twice as correct. :)
21:23 <Tuplanolla> The proofs probably don't concern time or space.
21:24 twandy joined
21:25 m4t joined
21:25 bilal80 joined
21:25 elfets joined
21:26 nschoe joined
21:26 perspectival joined
21:27 Mrd1 joined
21:27 <XorSwap> :t \h e y m 4 t -> undefined
21:27 <lambdabot> (Num a1, Eq a1) => p1 -> p2 -> p3 -> p4 -> a1 -> p5 -> a2
21:29 dogweather joined
21:29 <__monty__> Tuplanolla: I was just hoping the tedious process of formalization had uncovered some opportunities for optimization.
21:29 <Tuplanolla> I guess that's still possible.
21:31 <dstolfa> __monty__: the point is to just show that the thing you've specified holds certain desirable properties and then to prove that the haskell code actually refines the abstract specification
21:32 <__monty__> dstolfa: I know. That requires understanding what the haskell code does afaiu, which might lead to finding some spots that could be improved.
21:32 <dstolfa> __monty__: yep
21:32 <dmwit> I don't know of any formally verified software which is faster than its unverified counterpart.
21:33 <__monty__> I thought I'd heard about performance improvements in containers-verified before it was finished.
21:33 mceier joined
21:33 <phadej> __monty__: the changelog does say so http://hackage.haskell.org/package/containers-0.6.0.1/changelog
21:33 <phadej> Speed up Data.Set.union. (Thanks, Joachim Breitner.)
21:34 <__monty__> Aha, it wasn't merely a figment of my imagination.
21:34 Mrd1 left
21:34 <phadej> also the paper says that they didn't found any errors in containers, it's too well tested already
21:35 <dstolfa> dmwit: to be fair, that's mostly because there is a lack of formal semantics for the refined version, so you can only perform the transformations that you can show are correct. if we had formal models of the ISA that were verified by proofs in the uarch, we could build formally verified compilers that are potentially faster than current ones because we could see what we actually do in the uarch, and
21:35 <dstolfa> therefore could transform it to another valid state that satisfies these properties but maybe has better cache coherence
21:35 <phadej> ... and – since we found no bugs – attest to the superb quality of well-tested
21:35 <phadej> functional code
21:36 <dmwit> https://github.com/haskell/containers/commit/b1a05c3a26408b1af71e86cb450d41c3fed6884b looks like the commit in question. 3-4% speed increase is pretty small.
21:36 plugin joined
21:37 <dmwit> But I agree it's not nothing.
21:38 Mrd1 joined
21:39 Vulfe joined
21:39 <__monty__> Small improvement from a small change seems reasonable.
21:41 twandy joined
21:41 m4t left
21:42 fizbin joined
21:42 tomphp joined
21:45 kvda joined
21:46 dogweather joined
21:48 twandy joined
21:50 dogweather joined
21:51 valentinbuza joined
21:51 patlv joined
21:54 merijn joined
21:55 XorSwap joined
21:57 <rotaerk> > show "aoeu"
21:57 <lambdabot> "\"aoeu\""
21:57 <rotaerk> > show "aoeu\n"
21:57 <lambdabot> "\"aoeu\\n\""
21:57 <__monty__> dv buddies! : )
21:58 <rotaerk> :P
22:02 diwo joined
22:03 WhatisRT joined
22:04 <geekosaur> @v
22:04 <lambdabot> "\"#$%&'()*+,\""
22:04 andyhoang joined
22:05 twandy joined
22:06 conal joined
22:07 tsaka__ joined
22:07 greg_ joined
22:08 tokomak joined
22:08 kapil___ joined
22:09 xpycm joined
22:10 anonimito joined
22:11 anonimito joined
22:13 fmixing joined
22:13 tzemanovic joined
22:14 youtmon joined
22:15 striapach joined
22:15 noobly joined
22:20 woodson joined
22:21 drbrule joined
22:22 louispan joined
22:22 alexteves_ joined
22:22 codesoup joined
22:23 patlv joined
22:23 conal joined
22:24 <drbrule> where is the preferred pastebin to drop code for questions?
22:24 jfredett joined
22:25 m0rphism joined
22:26 plugin joined
22:27 vurtz joined
22:27 refold joined
22:28 WhereIsMySpoon__ left
22:28 alexteves joined
22:28 alexteves_ joined
22:28 <electrocat> @where lpaste
22:28 <lambdabot> http://lpaste.net/
22:28 <maerwald> drdo: https://privatebin.net/
22:28 <maerwald> drbrule: ^
22:31 <drbrule> thank you
22:33 lortabac_ joined
22:33 hamishmack joined
22:33 twandy joined
22:34 zero_byte joined
22:36 fryguybob joined
22:38 alexteves joined
22:39 plugin joined
22:40 daniel-s joined
22:41 DSM_ joined
22:42 camsbury joined
22:43 rprije joined
22:45 darjeeling_ joined
22:45 pera joined
22:47 son0p joined
22:49 Vulfe joined
22:50 comerijn joined
22:51 dogweather joined
22:51 con joined
22:53 emilypi joined
22:53 tzemanovic joined
22:56 UnkDevE joined
22:56 ma27 joined
22:57 SolidState joined
22:58 <UnkDevE> hey, is it possible for anyone to help me with some code?
22:58 <glguy> UnkDevE: Just ask your actual question and if someone's available to help with it they will.
22:58 <UnkDevE> thanks
22:58 <glguy> Depending on the question that can happen quickly or it can take some time
23:01 XorSwap joined
23:03 conal joined
23:03 Vulfe joined
23:06 stavross joined
23:08 chao-tic joined
23:09 Mrd1 joined
23:10 <UnkDevE> I have a recursive function which counter doesn't seem to increment
23:10 xcmw joined
23:10 <fishythefish> UnkDevE: what is `counter`? can you just link to some code?
23:10 <fishythefish> @where lpaste
23:10 <lambdabot> http://lpaste.net/
23:11 <UnkDevE> cool https://github.com/UnkDevE/LMCEmulatorHaskell/blob/master/LMCEmulator.hs#L279
23:11 <Mrd1> SeleQ
23:11 <UnkDevE> pc doesn't increment
23:13 pavonia joined
23:13 <fishythefish> UnkDevE: runRam on its own doesn't increment the pc; you're doing that in inp/outp, looks like
23:14 <UnkDevE> yup
23:14 <fishythefish> why only those two instructions?
23:15 <fishythefish> I'd probably expect runLine to be responsible for that
23:15 <glguy> line 279 probably should apply runRam to the result of runLine, and not the other way around
23:15 <UnkDevE> good point thank you
23:16 louispan joined
23:16 <electrocat> UnkDevE: unrelated to your issue, you should pattern match on constructors instead of testing equality using `==`
23:17 earldouglas joined
23:17 <electrocat> and don't use unsafePerformIO this way
23:17 mreh joined
23:17 <fishythefish> the unsafePerformIO is also a code smell
23:18 Tops2 joined
23:19 louispan joined
23:19 <UnkDevE> yeah unsafePerformIO is code smell, is there any other way of doing it?
23:20 <electrocat> UnkDevE: how familiar are you with monads?
23:20 <fishythefish> one way is to just add `IO` everywhere and don't try to get back out of it, but a better approach might be to separate the act of outputting to console from the evaluation of the LMC
23:20 _bo joined
23:21 <UnkDevE> not very on the monads side
23:21 <fishythefish> you don't have to be familiar with monads, just with manipulating IO expressions
23:21 diwo joined
23:21 kvda joined
23:22 pfurla_ joined
23:22 <electrocat> i could do 'StateT Environment IO' to keep it simple, you would need to make everything monadic anyway
23:24 <electrocat> UnkDevE: you'll learn how to do that in a more clean way eventually :p
23:24 <electrocat> you might want to read up about state monads
23:24 <UnkDevE> okay
23:24 Linter joined
23:26 <* hackage> ua-parser 0.7.5.0 - A library for parsing User-Agent strings, official Haskell port of ua-parser http://hackage.haskell.org/package/ua-parser-0.7.5.0 (MichaelXavier)
23:34 twandy joined
23:35 andyhoang joined
23:37 ericsagn1 joined
23:37 dbmikus_ joined
23:38 yate joined
23:38 raingloom joined
23:38 yate left
23:39 theDon joined
23:39 tabemann joined
23:39 bbrodriguez joined
23:40 bbrodriguez joined
23:43 dogweather joined
23:43 jackdk joined
23:44 zyla_ joined
23:44 fdjikqw joined
23:45 <fdjikqw> Can anyone think of a 1 line solution to output all the primes less than some input, and append "T" to all twin primes?
23:46 <hpc> some people can't think of it, so no :P
23:46 <hodapp> something smells like homework...
23:47 <fdjikqw> No, a contest problem
23:48 louispan joined
23:50 <infinisil> fdjikqw: How far have you gotten
23:51 merijn joined
23:51 davr0s joined
23:52 <DigitalKiwi> to the /join #haskell and ask them part
23:52 youtmon joined
23:52 <hpc> does it have to be one line?
23:53 xpycm joined
23:56 YongJoon joined
23:56 abhiroop joined
23:56 Forlorn_ joined
23:56 <dmwit> fdjikqw: Step 1 is do it on many lines.
23:56 <dmwit> Step 2 is insert semicolons.
23:58 <dmwit> (Step 0 is don't expect somebody else to do your work for you.)
23:58 alx741 joined
23:59 ubvnoxn joined