Skip to content

Commit

Permalink
add Fun.id to Kloth
Browse files Browse the repository at this point in the history
  • Loading branch information
zakybilfagih committed Aug 24, 2024
1 parent 10014e4 commit b77c095
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/runtime/melange/Kloth.ml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ module Option = struct

let map ~f opt = match opt with Some x -> Some (f x) | None -> None
end

module Fun = struct
let id = Fun.id
end
4 changes: 4 additions & 0 deletions packages/runtime/native/Kloth.ml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ module Option = struct

let map ~f opt = match opt with Some x -> Some (f x) | None -> None
end

module Fun = struct
let id = Fun.id
end
4 changes: 4 additions & 0 deletions packages/runtime/native/Kloth.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ module Option : sig
val map_with_default : 'a option -> 'b -> ('a -> 'b) -> 'b
val map : f:('a -> 'b) -> 'a option -> 'b option
end

module Fun : sig
val id : 'a -> 'a
end
4 changes: 2 additions & 2 deletions packages/runtime/native/shared/Css_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3059,8 +3059,8 @@ module TextDecorationLine = struct
(if lineThrough then Some {js|line-through|js} else None);
(if blink then Some {js|blink|js} else None);
|]
|> Kloth.Array.filter_map ~f:Fun.id
|> Kloth.Array.map_and_join ~f:Fun.id ~sep:{js| |js})
|> Kloth.Array.filter_map ~f:Kloth.Fun.id
|> Kloth.Array.map_and_join ~f:Kloth.Fun.id ~sep:{js| |js})
| #None.t -> None.toString
end

Expand Down
4 changes: 4 additions & 0 deletions packages/runtime/rescript/Kloth.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ module Option = struct

let map ~f opt = match opt with Some x -> Some (f x) | None -> None
end

module Fun = struct
external id : 'a -> 'a = "%identity"
end

0 comments on commit b77c095

Please sign in to comment.