Utils2

Plain source file: hs2alfa/AlfaSource/Utils2.hs (2004-01-23)

Utils2 is imported by: AbstractOps, UMatch, USubstitute.

module Utils2 where
--import Char

mix :: [[a]] -> [a] -> [a]
mix [] d = []
mix (x:xs) d = x++case xs of [] -> []; _ -> d ++ mix xs d

apBoth f (x,y) = (f x,f y)

splitEitherList xys = ([x|Left x<-xys],[y|Right y<-xys])

-- From HBC's module HO:
apFst f (x,y) = (f x,y)
apSnd f (x,y) = (x,f y)

-- From HBC's module ListUtil:
mapSnd f = map (apSnd f)
mapFst f = map (apFst f)

Index

(HTML for this module was generated on 2006-08-12. About the conversion tool.)