This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

Constraint.Semigroup

type alias Semigroup a r = { r | concat : a -> a -> a }

Generalized concatenation.

module Constraint.Semigroup exposing (..)

{-|
@docs Semigroup
@docs (++)
-}

import Constraint exposing (Constraint, (<&>), ask)

{-|
Generalized concatenation.
-}
type alias Semigroup a r =
  { r
  | concat : a -> a -> a
  }

{-|
Operator alias for `concat`.
-}
(++) : a -> a -> Constraint (Semigroup a r) a
(++) x y =
  ask <&> \{concat} ->
    concat x y