max3 2017-03-07 03:48:22
merijn, ...where else would they exist?
merijn 2017-03-07 03:48:42
max3: Deeply inlined and specialised
ski 2017-03-07 03:48:51
max3 : they could be fused, or otherwise partially evaluated, away
napping 2017-03-07 03:48:55
you didn't say anything about standard
mbw 2017-03-07 03:48:59
I have a question about Bifunctors (and maybe Profunctors). According to the lens tutorial on wikibooks, the Const functor is a "vacuous" functor, since both fmap and contramap amount to id. However you can define a Bifunctor instance, of which bimap/first allow applying altering the Const functor: http://lpaste.net/353288 . Is bimap something entirely different than fmap/contramap? Is there some intuition
merijn 2017-03-07 03:49:01
max3: The fact that you define a function 'foo', doesn't require such a function to actually exist after compilation
mbw 2017-03-07 03:49:05
behind this?
merijn 2017-03-07 03:49:13
max3: If all uses of 'foo' have been inlined directly in the calling code, then what?
napping 2017-03-07 03:49:22
max3: more simply, the GC can move things so it's trickty to have "A" address
merijn 2017-03-07 03:49:43
napping: That's the fun that gives us "reallyUnsafePtrEquality#" ;)
max3 2017-03-07 03:49:52
fine. excepting functions
napping 2017-03-07 03:50:01
merijn: precisely!
merijn 2017-03-07 03:50:10
Which honestly isn't nearly as scarily named as it oughta be
napping 2017-03-07 03:50:14
well, maybe some unsafeCoerce and pointer arithmetic too
merijn 2017-03-07 03:50:43
It's up there with accursedUnutterablePerformIO in terms of scariest functions :p
byorgey 2017-03-07 03:50:51
mbw: bimap is closely related to fmap. I'm not sure I really understand your question. In particular I don't understand your use of the word 'However'. The existence of a Bifunctor instance doesn't contradict the existence of Functor etc. instances
ski 2017-03-07 03:51:41
mbw : `Functor' is for functors from `Hask' to `Hask'. `Contravariant' is for functors from `Hask^op' to `Hask'. `Bifunctor' is for functors from `Hask * Hask' to `Hask'
tdammers 2017-03-07 03:52:02
Rodenbach: then I'd go with byorgey's suggestion... encode the possible programs in an AST, and write an interpreter for it
merijn 2017-03-07 03:52:26
max3: Well, for almost all non-functions you can derive Show easily enough. There's some exceptions which are a bit tricky, such as Handle, MVar, TVar, etc.
max3 2017-03-07 03:52:34
merijn, okay so why isn't it done by default is my poitn
byorgey 2017-03-07 03:52:34
merijn: note that every Bifunctor is necessarily also a Functor, since you can just pass 'id' as the first argument to bimap
byorgey 2017-03-07 03:52:34
sorry, that was meant for mbw
merijn 2017-03-07 03:52:34
mbw: Note that (assuming you're familiar with kind signatures) you have "Bifunctor :: (* -> * -> *) -> Constraint"
merijn 2017-03-07 03:52:39
Vs "Functor :: (* -> *) -> Constraint"
napping 2017-03-07 03:52:50
max3: there's also no syntax for asking not to derive something
Mike_G 2017-03-07 03:53:14
:( The idea was to somehow modify prelude and make complexes available everywhere, in all libraries. (Missusage of /r)
max3 2017-03-07 03:53:20
napping, that doesn't sound like a real impediment
ski 2017-03-07 03:53:36
sometimes you don't want a derived `Show' instance
merijn 2017-03-07 03:53:42
max3: Maybe library authors don't want to expose their implementation?
Rodenbach 2017-03-07 03:53:54
lol, it's the first time that I've done refactoring in Haskell. Changing the program to show function names took me 50 secs.
byorgey 2017-03-07 03:54:02
Rodenbach: =D
Rodenbach 2017-03-07 03:54:04
Funny, the compiler showed me all places that I had to update.
Mike_G 2017-03-07 04:17:37
Does hmatrix(or hblas) works with arbitrary dimensional complex-valued tensors?
Mike_G 2017-03-07 04:22:56
unsuitable :( wanna smth matlab-like
mbw 2017-03-07 04:23:32
I believe Eigen (C++) can work with arbitrary-dimensional tensors by now.
Mike_G 2017-03-07 04:24:02
are there haskell bindings?
mbw 2017-03-07 04:25:50
A quick search came up with this https://www.cs.utexas.edu/users/flame/BLISRetreat2015/slides/Devin_BLISRetreat_2015.pdf
mbw 2017-03-07 04:26:02
Might be something in terms of "things to search for"
mbw 2017-03-07 04:26:59
But I am amazed there are Haskell bindings, since Eigen relies heavily on Template Metaprogramming / Expression Templates (compile-time voodoo).
max3 2017-03-07 04:31:28
is there a way to upgrade a package using stack?
jchia_ 2017-03-07 04:34:42
lens-aeson question. I have a JSON string x = "{\"a\": {\"b\": 1, \"c\": 2}}". I want to extract the list of keys under the top-level "a" key from it, i.e. (Just ["b", "c"] :: Maybe [Text]). How do I do it with lens-aeson? I know how to get a Maybe (HashMap Text Value) using (x ^? key "a" . _Object).