Re: [Haskell-cafe] A functor for two Peano systems
6 Apr
2021
6 Apr
'21
1:27 a.m.
You should try to 1. destill which basic operations are necessary on the types Int, MyNum to make your algorithms work, 2. write a type class for these operations, 3. write type class instances for Int and MyNum, 4. write a generic algorithm that works for all members your class, which ideally looks almost identical to the specific code you already have. I dare say this is a common way of reducing boilerplate code in Haskell. BTW, you should consider Numeric.Natural instead of Int for Peano addition. Cheers Olaf
1737
Age (days ago)
1737
Last active (days ago)
0 comments
1 participants
participants (1)
-
Olaf Klinke