Search Haskell Channel Logs

Friday, February 10, 2017

#haskell channel featuring lambdabot, liste, flxw, monochrom, lpaste_, Taneb,

flxw 2017-02-09 22:56:09
Hi all. Is there a combinator for two functions a -> b, a -> c which gives a -> (b,c)?
Taneb 2017-02-09 22:56:28
:t (Control.Arrow.&&&)
lambdabot 2017-02-09 22:56:30
Arrow a => a b c -> a b c' -> a b (c, c')
Taneb 2017-02-09 22:56:54
> (reverse &&& length) "wxlf"
flxw 2017-02-09 22:56:57
(so that one doesn't need to write the lambda abstraction by hand)
lambdabot 2017-02-09 22:56:57
("flxw",4)
Taneb 2017-02-09 22:57:38
flxw, is this what you were after?
flxw 2017-02-09 22:58:35
cool, yes. thank you!
Taneb 2017-02-09 22:59:18
:)
lpaste_ 2017-02-09 23:08:48
monochrom pasted "let-polymorphism" at http://lpaste.net/352302
lpaste_ 2017-02-09 23:13:57
monochrom revised "let-polymorphism": "let-polymorphism" at http://lpaste.net/352302
monochrom 2017-02-09 23:17:04
@tell jle` http://lpaste.net/352302
lambdabot 2017-02-09 23:17:04
Consider it noted.
monochrom 2017-02-09 23:17:19
@tell dmwit http://lpaste.net/352302
lambdabot 2017-02-09 23:17:19
Consider it noted.
lpaste_ 2017-02-09 23:30:59
monochrom revised "let-polymorphism": "let-polymorphism" at http://lpaste.net/352302
thatguy 2017-02-09 23:43:06
what do the ! mean in front of the the Ints? data Matrix a = M { nrows :: !Int -- ^ Number of rows. , ncols :: !Int -- ^ Number of columns., mvect :: V.Vector (V.Vector a) } deriving Eq
liste 2017-02-09 23:43:20
thatguy: it's a strictness annotation
thatguy 2017-02-09 23:43:42
ah so it will get evaluated right when you make a matrix?
liste 2017-02-09 23:44:04
thatguy: https://wiki.haskell.org/Performance/Data_types#Strict_fields
thatguy 2017-02-09 23:44:17
liste, thanks!