nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

nicht verallgemeinerbare Typen

Von: Georg Bauhaus (bauhaus@futureapps.de) [Profil]
Datum: 25.10.2006 02:25
Message-ID: <1161735959.15641.13.camel@localhost>
Newsgroup: de.comp.lang.funktional
oder so Ähnliches bereitet mir gerade mit OCamL Kopfzerbrechen.
Weiß jemand, was geht hier vor geht? Wo ist der Unterschied
zwischen f und g hinsichtlich der "Rückgabe-Typen"?

module Frage =
struct

let f bedingung =
if bedingung then Printf.printf
else (print_string "bla"; Printf.printf)

let bed = false

let g =
if bed then Printf.printf
else (print_string "bla"; Printf.printf)

end ;;


File "frage.ml", line 2, characters 0-229:
The type of this module,
sig
val f : bool -> ('a, out_channel, unit) format -> 'a
val bed : bool
val g : ('_a, out_channel, unit) format -> '_a
end, contains type variables that cannot be generalized


Georg



[ Auf dieses Posting antworten ]

Antworten