Advanced Functional Prog.
back - up - cont
Parsing expressions
Next, we have to define sequential composition - i.e check first letter th
en
next letter for instance:
let thn p1 p2 (s:string) =
match p1 s with
| [(r,s')] -> p2 s'
| _ -> [];;
let (&&) = thn;;
((sym 'h') && (sym 'e') && (sym 'l')) "hello";;
Nb. The code illustrates again the capability of the language to use binary function (thn
) as infix operators (&&
).
3 - 18
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp