Add instance Eq1 Complex, Show1 Complex, and Read1 Complex
chessai .
chessai1996 at gmail.com
Sat Aug 10 02:50:29 UTC 2019
+1
On Fri, Aug 9, 2019, 10:26 PM Edward Kmett <ekmett at gmail.com> wrote:
> Makes sense to me. +1
>
> On Fri, Aug 9, 2019 at 6:15 PM Dannyu NDos <ndospark320 at gmail.com> wrote:
>
>> instance Eq1 Complex where
>> liftEq f (x :+ y) (u :+ v) = f x u && f y v
>>
>> instance Show1 Complex where
>> liftShowsPrec sp _ p (x :+ y) = showParen (p >= 6) (sp p x . showString "
>> :+ " . sp p y)
>>
>> instance Read1 Complex where
>> liftReadPrec rp _ = parens $ prec 6 $ do
>> x <- step rp
>> Symbol ":+" <- lexP
>> y <- step rp
>> return (x :+ y)
>> liftReadList = liftReadListDefault
>> liftReadListPrec = liftReadListPrecDefault
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190809/9fc142da/attachment.html>
More information about the Libraries
mailing list