<maayhem>
pango_, excellent, it seems to be what I want :)
<bluestorm>
i guess reasoning only on type equalities would have given you the desired function
<bluestorm>
List.map : ('a -> 'b) -> 'a list -> 'b list
<bluestorm>
so elist : 'a list
<bluestorm>
translate_program : 'idx * 'a -> ('c list * 'idx)
<bluestorm>
you want the 'c list part, so 'b = 'c list
<bluestorm>
so you want your map function to be 'a -> 'c list, given a var indices : 'idx
<bluestorm>
(fun a -> translate_program (indices, a)) is 'a -> 'c list * 'idx
<bluestorm>
so (fun a -> fst (translate_program (indices, a))) is the only solution
<pango_>
let's say it's the simplest correctly typed expression. it could still be wrong ;) (it's much like checking unit's consistency in physics: it can be helpful to detect mistakes, but not to prove that some formula is correct)
<bluestorm>
hm pango_
<maayhem>
bluestorm, I am still quite novice in ocaml syntax, thats why I asked for some help ..
<bluestorm>
i'm not sure with the very few variables involved here
<bluestorm>
that you can come up with a wrong good-typed non-obvious solution
<bluestorm>
hm
<bluestorm>
even obvious
<bluestorm>
if you constrain the return type to be that 'c list
<bluestorm>
then fst (...) is your only solution (no other 'c producing function known), and then you have to use the only 'idx value
<bluestorm>
seems the function part of the List.map is uniquely determined
<maayhem>
yea I knew fst had to be involved, but I didnt know the syntax fun c -> ... inside a Map
<maayhem>
never used as such in the past, but now I know
buluca has quit [Read error: 113 (No route to host)]
Anarchos has quit ["went to bed"]
<bluestorm>
maayhem: (fun e -> ...) are lambda expressions
<bluestorm>
you can use them anywhere, not just inside Map
<bluestorm>
in the toplevel for example :
<bluestorm>
# fun x -> x + 1;;
<bluestorm>
- : int -> int = <fun>
<maayhem>
yea, just never had to use them inside Map until now ..
<bluestorm>
ah
<maayhem>
thanks ! bye
maayhem has left #ocaml []
dbueno has joined #ocaml
dbueno has quit ["This computer has gone to sleep"]
dbueno has joined #ocaml
postalchris has joined #ocaml
postalchris has quit [Client Quit]
nashdj has quit [Read error: 110 (Connection timed out)]
bluestorm has quit [Remote closed the connection]
middayc_ has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
kmeyer has joined #ocaml
thesoko has joined #ocaml
thesoko has quit [Remote closed the connection]
seafood_ has joined #ocaml
ygrek has joined #ocaml
ita has quit [Read error: 104 (Connection reset by peer)]
seafood_ has quit [Read error: 110 (Connection timed out)]
Associat0r has quit []
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
Associat0r has joined #ocaml
dbueno has quit ["Leaving"]
AxleLonghorn has joined #ocaml
__suri_ has joined #ocaml
middayc_ has quit []
__suri__ has joined #ocaml
Associat0r has quit [Success]
__suri has quit [Read error: 110 (Connection timed out)]
__suri_ has quit [Read error: 110 (Connection timed out)]
__suri__ has quit [Connection timed out]
thermoplyae has joined #ocaml
mordaunt has joined #ocaml
buluca has joined #ocaml
__suri has joined #ocaml
ygrek has quit [Remote closed the connection]
kmeyer has quit [Remote closed the connection]
kmeyer has joined #ocaml
AxleLonghorn has left #ocaml []
jderque has joined #ocaml
thermoplyae has quit ["daddy's in space"]
ygrek has joined #ocaml
Snark has joined #ocaml
ttamttam has joined #ocaml
asmanur has joined #ocaml
jderque has quit [Read error: 110 (Connection timed out)]
asmanur_ has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
asmanur__ has joined #ocaml
asmanur_ has quit [Read error: 110 (Connection timed out)]
asmanur_ has joined #ocaml
_asmanur has joined #ocaml
asmanur__ has quit [Read error: 110 (Connection timed out)]
_asmanur is now known as asmanur
asmanur_ has quit [Read error: 110 (Connection timed out)]
leo037 has joined #ocaml
filp has joined #ocaml
Tetsuo has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
l_a_m has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood__ has joined #ocaml
hkBst has joined #ocaml
seafood__ has quit [Read error: 104 (Connection reset by peer)]
seafood__ has joined #ocaml
seafood___ has joined #ocaml
pippijn_ is now known as pippijn
seafood_ has quit [Read error: 110 (Connection timed out)]
seafood__ has quit [Read error: 110 (Connection timed out)]
seafood___ has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
S1ugg0 has joined #ocaml
S1ugg0 has left #ocaml []
seafood__ has joined #ocaml
jderque has joined #ocaml
seafood__ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has quit [Connection timed out]
seafood_ has joined #ocaml
bluestorm has joined #ocaml
netx has quit [Remote closed the connection]
seafood__ has joined #ocaml
leo037 has quit ["ici, de la neige. Voir photo sur mon blog :)"]
seafood_ has quit [Read error: 110 (Connection timed out)]
netx has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]