Re: [Haskell-cafe] A functor for two Peano systems

5 Apr
2021
5 Apr
'21
3:57 p.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
1506
Age (days ago)
1506
Last active (days ago)
0 comments
1 participants
participants (1)
-
Olaf Klinke