git @ Cat's Eye Technologies Robin / master src / Language / Robin / Facilities.hs
master

Tree @master (Download .tar.gz)

Facilities.hs @masterraw · history · blame

-- Copyright (c) 2012-2024, Chris Pressey, Cat's Eye Technologies.
-- This file is distributed under a 2-clause BSD license.  See LICENSES/ dir.
-- SPDX-License-Identifier: LicenseRef-BSD-2-Clause-X-Robin

module Language.Robin.Facilities where

import Language.Robin.Expr

type Event = Either String [Expr]
type FacilityHandler = Expr -> IO [Expr]
type WaitForEvents = IO Event

data Facility = Facility {
                  handler :: FacilityHandler,
                  waiter :: WaitForEvents
                }

nullWaiter :: WaitForEvents
nullWaiter = return $ Right []