Skip to content

Commit

Permalink
more pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Nov 29, 2024
1 parent fde9ac2 commit 0c45672
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Stdlib/Data/List.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ phead {A} {{Partial}} : List A -> A
| (x :: _) := x
| nil := fail "head: empty list";

{-# specialize: true, inline: case #-}
instance
eqListI {A} {{Eq A}} : Eq (List A) :=
let
Expand All @@ -37,6 +38,7 @@ eqListI {A} {{Eq A}} : Eq (List A) :=
isMember {A} {{Eq A}} (elem : A) (list : List A) : Bool :=
isElement (Eq.eq) elem list;

{-# specialize: true, inline: case #-}
instance
ordListI {A} {{Ord A}} : Ord (List A) :=
let
Expand Down Expand Up @@ -71,7 +73,7 @@ functorListI : Functor List :=
map := listMap;
};

{-# specialize: true, inline: true #-}
{-# specialize: true, inline: case #-}
instance
monomorphicFunctorListI {A} : Monomorphic.Functor (List A) A :=
fromPolymorphicFunctor;
Expand All @@ -84,7 +86,7 @@ polymorphicFoldableListI : Polymorphic.Foldable List :=
rfor := listRfor;
};

{-# specialize: true, inline: true #-}
{-# specialize: true, inline: case #-}
instance
foldableListI {A} : Foldable (List A) A := fromPolymorphicFoldable;

Expand Down
1 change: 1 addition & 0 deletions Stdlib/Data/Map.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ value {Key Value} (binding : Binding Key Value) : Value :=
toPair {Key Value} (binding : Binding Key Value) : Pair Key Value :=
key binding, value binding;

{-# specialize: true, inline: case #-}
instance
bindingKeyOrdering {Key Value} {{Ord Key}} : Ord (Binding Key Value) :=
mkOrd@{
Expand Down
2 changes: 1 addition & 1 deletion Stdlib/Trait/Foldable/Monomorphic.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Foldable public;

--- Make a monomorphic ;Foldable; instance from a polymorphic one.
--- All polymorphic types that are an instance of ;Poly.Foldable; should use this function to create their monomorphic ;Foldable; instance.
{-# inline: case #-}
{-# inline: always #-}
fromPolymorphicFoldable
{F : Type -> Type}
{{foldable : Poly.Foldable F}}
Expand Down
2 changes: 1 addition & 1 deletion Stdlib/Trait/Functor/Monomorphic.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Functor (Container Elem : Type) :=

open Functor public;

{-# inline: case #-}
{-# inline: always #-}
fromPolymorphicFunctor
{F : Type -> Type} {{Poly.Functor F}} {Elem} : Functor (F Elem) Elem :=
mkFunctor@{
Expand Down

0 comments on commit 0c45672

Please sign in to comment.