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
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
- Georg Bauhaus (25.10.2006 12:41)
- Ingo Menger (26.10.2006 14:27)
- Georg Bauhaus (26.10.2006 15:15)
- Ingo Menger (26.10.2006 15:54)
- Georg Bauhaus (26.10.2006 16:41)
