snoc "tes" 't' == "test" \xs x -> unsnoc (snoc xs x) == Just (xs,x)
>>> Nothing $> "foo" Nothing
>>> Just 90210 $> "foo" Just "foo"Replace the contents of an Either Int Int with a constant String, resulting in an Either Int String:
>>> Left 8675309 $> "foo" Left 8675309
>>> Right 8675309 $> "foo" Right "foo"Replace each element of a list with a constant String:
>>> [1,2,3] $> "foo" ["foo","foo","foo"]Replace the second element of a pair with a constant String:
>>> (1,2) $> "foo" (1,"foo")
>>> Nothing $> "foo" Nothing >>> Just 90210 $> "foo" Just "foo"Replace the contents of an Either Int Int with a constant String, resulting in an Either Int String:
>>> Left 8675309 $> "foo" Left 8675309 >>> Right 8675309 $> "foo" Right "foo"Replace each element of a list with a constant String:
>>> [1,2,3] $> "foo" ["foo","foo","foo"]Replace the second element of a pair with a constant String:
>>> (1,2) $> "foo" (1,"foo")
>>> Nothing $> "foo" Nothing
>>> Just 90210 $> "foo" Just "foo"Replace the contents of an Either Int Int with a constant String, resulting in an Either Int String:
>>> Left 8675309 $> "foo" Left 8675309
>>> Right 8675309 $> "foo" Right "foo"Replace each element of a list with a constant String:
>>> [1,2,3] $> "foo" ["foo","foo","foo"]Replace the second element of a pair with a constant String:
>>> (1,2) $> "foo" (1,"foo")
do as pure bwith an inferred Functor constraint.
>>> Nothing $> "foo" Nothing >>> Just 90210 $> "foo" Just "foo"Replace the contents of an Either Int Int with a constant String, resulting in an Either Int String:
>>> Left 8675309 $> "foo" Left 8675309 >>> Right 8675309 $> "foo" Right "foo"Replace each element of a list with a constant String:
>>> [1,2,3] $> "foo" ["foo","foo","foo"]Replace the second element of a pair with a constant String:
>>> (1,2) $> "foo" (1,"foo")
>>> V2 3 4 ^* 2 V2 6 8
>>> take 1 (intersperse undefined ('a' : undefined)) "a"
>>> take 2 (intersperse ',' ('a' : undefined)) "a*** Exception: Prelude.undefined
>>> intersperse ',' "abcde" "a,b,c,d,e"
>>> intersperse 1 [3, 4, 5] [3,1,4,1,5]
cons 't' "est" == "test" \x xs -> uncons (cons x xs) == Just (x,xs)
>>> intersperse ',' "abcde" "a,b,c,d,e"intersperse has the following laziness properties:
>>> take 1 (intersperse undefined ('a' : undefined)) "a" >>> take 2 (intersperse ',' ('a' : undefined)) "a*** Exception: Prelude.undefined