1
0
forked from GitHub/gf-core

PGF.Haskell: adding operators for selections from tables

This commit is contained in:
hallgren
2015-02-12 16:09:33 +00:00
parent 43a873b53f
commit 0058a79a8f

View File

@@ -3,6 +3,7 @@
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}
module PGF.Haskell where
import Control.Applicative((<$>),(<*>))
import Control.Monad(join)
import Data.Char(toUpper)
import Data.List(isPrefixOf)
import qualified Data.Map as M
@@ -65,4 +66,10 @@ to_R_s r = R_s (proj_s r)
infixr 5 +++
xs +++ ys = (++) <$> xs <*> ys
-- | Concatenation with variants
xs +++ ys = (++) <$> xs <*> ys
-- | Selection from tables with variants
t ! p = join (t p)
t !$ p = join (t <$> p)
t !* p = join (t <*> p)