Skip to content

Commit

Permalink
Merge pull request #5 from haskell-works/enable-record-dot-syntax-glo…
Browse files Browse the repository at this point in the history
…bally

Enable record dot syntax globally
  • Loading branch information
newhoggy authored Nov 8, 2024
2 parents 4424882 + 88bab5a commit 1b84546
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
4 changes: 3 additions & 1 deletion hw-prelude.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ common project-config
FlexibleContexts
FlexibleInstances
LambdaCase
NoFieldSelectors
NoImplicitPrelude
OverloadedRecordDot
OverloadedStrings
RankNTypes
ScopedTypeVariables
TypeApplications
TypeOperators
TypeSynonymInstances
ghc-options: -Wall

if flag(werror)
Expand Down Expand Up @@ -88,7 +91,6 @@ library
HaskellWorks.Data.String
HaskellWorks.Error
HaskellWorks.Error.Types
HaskellWorks.Error.Types.All
HaskellWorks.Error.Types.GenericError
HaskellWorks.Error.Types.TimedOut
HaskellWorks.IO.Network.NamedPipe
Expand Down
8 changes: 4 additions & 4 deletions src/HaskellWorks/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ onLeftM_ :: forall e a m. ()
onLeftM_ f action = onLeft_ f =<< action

-- | Handle the case where a list with many (more than one) elements.
onMany :: forall a m.()
onMany :: forall a m. ()
=> Monad m
=> (NonEmpty a -> m (Maybe a))
-> [a]
Expand All @@ -78,7 +78,7 @@ onMany h as = case as of
(x : xs) -> h (x :| xs)

-- | Handle the case where an effectul function returns a list with many (more than one) elements.
onManyM :: forall a m.()
onManyM :: forall a m. ()
=> Monad m
=> (NonEmpty a -> m (Maybe a))
-> m [a]
Expand All @@ -87,7 +87,7 @@ onManyM h f =
f >>= onMany h

-- | Handle the case where a list with many (more than one) elements.
onMany_ :: forall a m.()
onMany_ :: forall a m. ()
=> Monad m
=> m (Maybe a)
-> [a]
Expand All @@ -98,7 +98,7 @@ onMany_ h as = case as of
_ -> h

-- | Handle the case where an effectul function returns a list with many (more than one) elements.
onManyM_ :: forall a m.()
onManyM_ :: forall a m. ()
=> Monad m
=> m (Maybe a)
-> m [a]
Expand Down
15 changes: 9 additions & 6 deletions src/HaskellWorks/Error/Types.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module HaskellWorks.Error.Types
( -- * Error types
GenericError(GenericError),
TimedOut(TimedOut),
) where
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TypeSynonymInstances #-}

import HaskellWorks.Error.Types.All
module HaskellWorks.Error.Types (
GenericError (..),
TimedOut(..),
) where

import HaskellWorks.Error.Types.GenericError
import HaskellWorks.Error.Types.TimedOut
10 changes: 0 additions & 10 deletions src/HaskellWorks/Error/Types/All.hs

This file was deleted.

0 comments on commit 1b84546

Please sign in to comment.