Search Haskell Channel Logs

Wednesday, February 22, 2017

#haskell channel featuring lyxia, Jinixt, maybefbi, merijn, ongy, Taneb,

ongy 2017-02-22 01:01:36
I think that's not an easy task for xmonad. Afaik that's intentional behaviour that also breaks the normal System.Process api (I don't remember why they chose to do that)
maybefbi 2017-02-22 01:33:22
i had a haskell interview just now. and today i learned that there is a if there isn't a (Foldable t) => .. constraint, your data structure can have other types of folds which have a foldr :: (a -> .. b -> ..) -> z -> U k -> x
maybefbi 2017-02-22 01:34:21
basically anything that can change your data type into another value can be called a fold
maybefbi 2017-02-22 01:35:33
does that make sense?
Jinixt 2017-02-22 01:36:53
let's say i have a complex data structure, like a tree where leaves are lists, and i want to find some inner structure inside this data. "a tree node where the second element in the list is 5 and the sibling tree node has 10 elements in the list"
Jinixt 2017-02-22 01:37:11
is there any alternative to doing it "by hand"?
maybefbi 2017-02-22 01:37:33
doing what "by hand"?
merijn 2017-02-22 01:37:53
Sounds like something for lens
Jinixt 2017-02-22 01:38:29
basically i would like some declarative way to talk about sub-structures
Jinixt 2017-02-22 01:38:40
to locate them and modify them
athan 2017-02-22 01:38:57
yea lens is the berst, aroooound
Jinixt 2017-02-22 01:39:00
maybe lens works yeah
maybefbi 2017-02-22 01:39:20
Jinixt, just invent your own list. e.g. a nested list of ints is like this: data NestedInt = I Int -> N [NestedInts]
maybefbi 2017-02-22 01:39:34
shit typo
maybefbi 2017-02-22 01:39:37
what i meant was
lyxia 2017-02-22 01:39:45
maybefbi: https://wiki.haskell.org/Catamorphisms
maybefbi 2017-02-22 01:39:49
data NestedInt = I Int | N [NestedInts]
maybefbi 2017-02-22 01:40:06
sorry im a bit drunk
maybefbi 2017-02-22 01:40:47
lyxia, nice
Jinixt 2017-02-22 01:40:50
maybefbi: i never spoke of having an integer on the leaf nodes though
maybefbi 2017-02-22 01:41:04
ok thats ok
Jinixt 2017-02-22 01:41:05
bit of a messy example but otherwise it would seem trivial
maybefbi 2017-02-22 01:41:24
Jinixt, ok let me see if i can do your messy example
Jinixt 2017-02-22 01:42:50
maybe two constraints make sense here, one to find the "central" object, and from there you can see everything relative to it and decide whether it's a match
maybefbi 2017-02-22 01:43:37
Jinixt, data SecondElementIs5List = I Int | SecondElementIs5 | Cons Int SecondElementIs5List
Jinixt 2017-02-22 01:43:42
to put it into some more real context i'm thinking of AST optimization passes
Jinixt 2017-02-22 01:43:57
maybefbi: what
Jinixt 2017-02-22 01:44:02
why would you put that in the type
Taneb 2017-02-22 01:44:09
Are there any maintained Haskell implementations other than GHC these days
Jinixt 2017-02-22 01:44:09
it's runtime data
quchen_ 2017-02-22 01:44:29
UHC is maintained, no?
Jinixt 2017-02-22 01:44:46
is frege a full haskell implementation? i forget
merijn 2017-02-22 01:44:48
UHC, yeah
maybefbi 2017-02-22 01:45:04
Jinixt, sorry i thought you wanted an alternate implementation of a list with some properties