Towards a prevalent alternative prelude?

Deprecate partial functions from the Prelude, giving them new quarantined homes · Issue #70 · haskell/core-libraries-committee · GitHub :


andreasabel:


Gabriella439:


Gabriella439:

  • head :: a -> [a] -> a
    head d []     = d
    head _ (x:xs) = x
    
    tail :: a -> [a] -> a
    tail d []     = d
    tail _ (_:xs) = xs
    
    init :: a -> [a] -> [a]
    init d []     = d
    init _ [_]    = []
    init d (x:xs) = xs : init d xs
    
    last :: a -> [a] -> [a]
    last d []     = d
    last _ [x]    = x
    last _ (_:xs) = last d xs
    

soupi:

  • module Tutorial_Prelude where
    import Prelude hiding (
        head, tail, init, last, ...
    )
    

emilypi: