Class IsJust


public class IsJust extends PrimitiveFunction
Checks if value is Just.
  • Constructor Details

    • IsJust

      public IsJust()
  • Method Details

    • name

      public Name name()
      Returns the name of this primitive function.
      Specified by:
      name in class PrimitiveFunction
      Returns:
      the name "hydra.lib.maybes.isJust"
    • type

      public TypeScheme type()
      Returns the type scheme of this primitive function.
      Specified by:
      type in class PrimitiveFunction
      Returns:
      the type scheme for checking if an optional is present
    • implementation

      protected Function<List<Term>,Flow<Graph,Term>> implementation()
      Returns the implementation of this primitive function.
      Specified by:
      implementation in class PrimitiveFunction
      Returns:
      a function that checks if an optional value is present
    • apply

      public static <X> boolean apply(Maybe<X> opt)
      Checks if an optional value is present (Just).
      Type Parameters:
      X - the value type
      Parameters:
      opt - the optional value to check
      Returns:
      true if the optional contains a value, false otherwise