Post #2543705
2026-05-13 11:38 UTC
Problem of the day:
Derive a fused function equal to `dupLast . dupLast` where
dupLast [] = []
dupLast [x] = [x,x]
dupLast (x:xs) = x : dupLast xs
Experienced functional programmers might see at a glance what the fused function looks like, but how do we derive it formally from the definition of `dupLast`?
#haskell #functionalprogramming
Replies (0)
No replies.