Skip to content

Commit

Permalink
Updating: very very minorly
Browse files Browse the repository at this point in the history
  • Loading branch information
githwxi committed Sep 14, 2024
1 parent 44efbb3 commit ab09f82
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
61 changes: 61 additions & 0 deletions prelude/DATS/VT/list001_vt.dats
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,67 @@ gseq_strmize0
(* ****** ****** *)
(* ****** ****** *)
//
(*
HX-2024-09-14:
Sat 14 Sep 2024 03:04:03 PM EDT
*)
//
#impltmp
< x0:t0 >
< y0:t0 >
list_vt_map0
( xs ) = let
//
fnx
loop
{i:nat}.<i>.
( xs
: ~list_vt(x0,i)
, r0
: &(?list_vt(y0)) >> list_vt(y0,i)
) : void =
(
case+ xs of
| ~
list_vt_nil() =>
(r0 := list_vt_nil())
| ~
list_vt_cons(x0, xs) =>
let
val y0 =
map$fopr0<x0><y0>(x0)
val () =
(r0 := list_vt_cons(y0, _))
in
(
loop(xs, r0.1); $fold(r0))
end
) (* end of [loop] *)
//
in
//
let
var r0: list_vt(y0)
val () = loop(xs, r0) in r0 end//let
//
end(*let*)//end-of-[ list_vt_map0(...) ]
//
(* ****** ****** *)
//
#impltmp
< x0:t0 >
< y0:t0 >
list_vt_map0_f1un
(xs, f0) =
(
list_vt_map0<x0><y0>(xs)) where
{
#impltmp map$fopr0<x0><y0>(x0) = f0(x0)
}(*where*)//end-of-[list_vt_map0_f1un(...)]
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

Expand Down
7 changes: 6 additions & 1 deletion prelude/TEST/CATS/JS/test09_llist00.dats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ For testing prelude/JS!
(* ****** ****** *)
//
val ns =
list_vt_nfun(10, lam(i) => i)
list_vt_nfun
(10, lam(i) => i)
//
val ns =
map0_fun(ns, lam(i:sint)=>i*i)
//
val () = print0s("ns = ", ns, "\n")
//
(* ****** ****** *)
Expand Down
2 changes: 1 addition & 1 deletion srcgen1/prelude/DATS/VT/list000_vt.dats
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ in
let
var r0: list_vt(y0)
val () = loop(xs, r0) in r0 end
end (*let*)//end of [list_map0_vt(...)]
end (*let*)//end of [list_vt_map0_vt(...)]
//
(* ****** ****** *)

Expand Down

0 comments on commit ab09f82

Please sign in to comment.