1
Fork 0
mirror of https://github.com/Jaxan/nominal-lstar.git synced 2025-04-27 14:47:45 +02:00

Optimization of row function.

This commit is contained in:
Michał Szynwelski 2016-06-14 00:09:16 +02:00
parent cb09b2d306
commit e683a4e384

View file

@ -22,7 +22,7 @@ type Row i o = Fun [i] o
-- `row is` denotes the data of a single row
-- that is, the function E -> O
row :: (NominalType i, NominalType o) => Table i o -> [i] -> Fun [i] o
row t is = sum (apply (curry t) is)
row t is = mapFilter (\((a,b),c) -> maybeIf (eq is a) (b,c)) t
-- `rowa is a` is the row for the one letter extensions
rowa :: (NominalType i, NominalType o) => Table i o -> [i] -> i -> Fun [i] o