We investigate a modality for controlling the behaviour of recursive functional programs on infinite structures which is completely silent in the syntax. The latter means that programs do not contain "marks" showing the application of the introduction and elimination rules for the modality. This shifts the burden of controlling recursion from the programmer to the compiler. To do this, we introduce a typed lambda calculus à la Curry with a silent modality and guarded recursive types. The typing discipline guarantees normalisation and can be transformed into an algorithm which infers the type of a program. skip xs " xfst xs,skip psnd psnd xsqqy CC Creative Commons 8:2
Paula SeveriVol. 15:1 which deletes the elements at even positions of a stream using the type Str1 Nat Ñ Str2 Nat where Str2 t " tˆ‚ ‚ Str2 t . The temporal modal operator ‚ allows to type many productive functions which are rejected by the proof assistant Coq [9]. Lazy functional programming is acknowledged as a paradigm that fosters software modularity [14] and enables programmers to specify computations over possibly infinite data structures in elegant and concise ways. We give some examples that show how modularization and compositionality can be achieved using the modal operator. An important recursive pattern used in functional programming for modularisation is foldr defined byThe type of foldr which is pt Ñ ‚s Ñ sq Ñ Str1 t Ñ s, is telling us what is the safe way to build functions. While it is possible to type 8:4
Paula SeveriVol. 15:1