[Haskell-cafe] Extending the idea of a general Num to other types?

Henning Thielemann lemming at henning-thielemann.de
Mon Sep 3 15:28:22 EDT 2007


On Mon, 3 Sep 2007, Peter Verswyvelen wrote:

> Okay. Now the following might not make sense at all, but... isn't the
> abstract concept of a list just a sequence of elements (okay, with a
> whole lot of extra properties)? So couldn't we write:   do { 1;2;3;4 }
> instead of [1,2,3,4] somehow for some special "list builder" monad? And
> then do {1;2;3;4 } could be lifted to any kind of structure when you run
> it through a different builder. Ah, I guess not... I'm not familiar
> enough with monads.

Why not just
 FancySequence.fromList [1,2,3,4]
  or
 FancySequence.fromList $ 1:2:3:4:[]
?


More information about the Haskell-Cafe mailing list