dupe 12 == (12, 12)
>>> dup "foo" ("foo","foo") >>> dup () ((),())
\x -> (x::Rational) == (uncurry (+) $ mapFst fromInteger $ splitFraction x)
\x -> uncurry (==) $ mapFst (((x::Double)-) . fromInteger) $ splitFraction x
\x -> uncurry (==) $ mapFst (((x::Rational)-) . fromInteger) $ splitFraction x
\x -> splitFraction x == (floor (x::Double) :: Integer, fraction x)
\x -> splitFraction x == (floor (x::Rational) :: Integer, fraction x)
RealRing.genericSplitFraction =~= (NP.splitFraction :: Double -> (Integer,Double))
RealRing.genericSplitFraction =~= (NP.splitFraction :: Rational -> (Integer,Rational))
>>> uncons [] Nothing
>>> uncons [a, b, c] Just (a,[b,c])
>>> uncons [] Nothing
>>> uncons [1, 2, 3] Just (1,[2,3])
>>> unsnoc (LazyT.pack "hello!") Just ("hello",'!')
>>> unsnoc (LazyT.pack "") Nothing
>>> unsnoc (Seq.fromList [b,c,a]) Just (fromList [b,c],a)
>>> unsnoc (Seq.fromList []) Nothing
>>> unsnoc "hello!" Just ("hello",'!')
>>> unsnoc "" Nothing