Production Haskell by Matt Parsons

Production Haskell by Matt Parsons

Author:Matt Parsons [Matt Parsons]
Language: eng
Format: epub
Publisher: leanpub.com
Published: 2020-10-07T00:00:00+00:00


Looking much nicer. Working with the list constructor functions is annoying though. A common pattern is to have a single listing: NEL.replicate 5 (155 x 5) is okay, but it’d be nicer to write that as 155 x 5 x 5. So let’s write an instance of Num for our NonEmpty Set.

1 instance 2 (a ~ Int, b ~ Int) 3 => 4 Num (X -> a -> X -> b -> NonEmpty Set) 5 where 6 fromInteger i = \X r X s -> fromInteger i x r *: s 7 8 (*:) :: Set -> Int -> NonEmpty Set 9 (*:) w i = w :| replicate (i-1) w 10 11 firstSession = 12 2019 05 07 #: 13 [ "bench press" %: 14 155 x 5 x 5 15 , "deadlift" %: 16 [ 225 x 5 17 , 275 x 3 18 ] 19 <> 315 x 1 x 3 20 ]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.