TailRecursion.dcl 286 Bytes
Newer Older
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
1
2
3
4
5
6
7
definition module Sapl.Transform.TailRecursion

import Data.Maybe
from Sapl.SaplStruct import :: SaplTypedVar, :: SaplTerm

// Topological sort of the let definitions. Returns Nothing if a cycle is detected
sortSetters :: ![(SaplTypedVar, SaplTerm)] -> Maybe [(SaplTypedVar, SaplTerm)]