[Haskell-beginners] How to extend fuinctions?

Heinrich Ody heinrich.ody at gmail.com
Fri Feb 22 18:35:19 CET 2013


Hi,

I have a function Delta and two sets S and A. Delta maps some elements
from (S x A) to S.
How can I extend Delta to some Delta' such that it assigns to every
pair in (S x A) that Delta is not defined for a value not occuring in
S?

Something like:
Delta' = if (Delta s a) /= _Undefined_
    then Delta s a
    else if () n
where n is the new value.

However Delta' should not assign values to pairs not in (S x A).
Note: (S x A) is meant to be the set-crossprroduct.

Background: I want to learn Haskell by building a small library for
Finite State Automata, Büchi Automata etc. I need this extension of
Delta for making automata complete.

Regards and thanks for reading,
Heinrich



More information about the Beginners mailing list