Siegmeyer
Siegmeyer

Reputation: 4512

Haskell "(.|.)" syntax

What does this syntax mean? (in the context of module declaration)

Example:

module XMonad (
    module XMonad.Main,
    module XMonad.Core,
    module XMonad.Config,
    module XMonad.Layout,
    module XMonad.ManageHook,
    module XMonad.Operations,
    module Graphics.X11,
    module Graphics.X11.Xlib.Extras,
    (.|.),
    MonadState(..), gets, modify,
    MonadReader(..), asks,
    MonadIO(..)
) where

Can't find anything using search engines.

Upvotes: 0

Views: 131

Answers (1)

jkeuhlen
jkeuhlen

Reputation: 4507

It means "Bitwise or". It is an operator that the XMonad package re-exports. It is originally defined in Data.Bits.

https://hackage.haskell.org/package/xmonad-0.13/docs/XMonad.html#v:.-124-.

(.|.) :: Bits a => a -> a -> a #

    Bitwise "or"

In Haskell, anything defined between ( ... ) is an operator, which is a function that works by default as infix notation.

Upvotes: 3

Related Questions