Skip to content

Commit

Permalink
apply fourmolu formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed May 22, 2024
1 parent 6e77ed7 commit e6cdffc
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 21 deletions.
12 changes: 6 additions & 6 deletions src/Disco/AST/Surface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ module Disco.AST.Surface (
)
where

import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty as NE
import Prelude hiding ((<>))
import Control.Lens ((%~), _1, _2, _3)
import Data.Char (toLower)
import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty as NE
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Data.Void
import Disco.Effects.LFresh
import Polysemy hiding (Embed, embed)
import Polysemy.Reader
import Disco.AST.Generic
import Disco.Effects.LFresh
import Disco.Extensions
import Disco.Pretty
import Disco.Syntax.Operators
import Disco.Syntax.Prims
import Disco.Types
import Polysemy hiding (Embed, embed)
import Polysemy.Reader
import Unbound.Generics.LocallyNameless hiding (LFresh (..), lunbind)
import Prelude hiding ((<>))

-- | The extension descriptor for Surface specific AST types.
data UD
Expand Down
4 changes: 2 additions & 2 deletions src/Disco/Desugar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ where
import Control.Monad (zipWithM)
import Data.Bool (bool)
import Data.Coerce
import Data.List.NonEmpty (NonEmpty(..))
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import Data.Maybe (fromMaybe, isJust)
import Disco.AST.Desugared
import Disco.AST.Surface
import Disco.AST.Typed
import Disco.Effects.Fresh
import Disco.Module
import Disco.Names
import Disco.Syntax.Operators
import Disco.Syntax.Prims
import Disco.Typecheck (containerTy)
import Disco.Types
import Disco.Effects.Fresh
import Polysemy (Member, Sem, run)
import Unbound.Generics.LocallyNameless (
Bind,
Expand Down
2 changes: 1 addition & 1 deletion src/Disco/Interactive/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Control.Lens (
(?~),
(^.),
)
import Control.Monad (forM_, when, void)
import Control.Monad (forM_, void, when)
import Control.Monad.Except ()
import Data.Bifunctor (second)
import Data.Char (isSpace)
Expand Down
8 changes: 4 additions & 4 deletions src/Disco/Module.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
-- to resolve the location of a module on disk.
module Disco.Module where

import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty as NE
import Data.Data (Data)
import GHC.Generics (Generic)
import Control.Lens (
Getting,
foldOf,
Expand All @@ -28,10 +24,14 @@ import Control.Lens (
import Control.Monad (filterM)
import Control.Monad.IO.Class (MonadIO (..))
import Data.Bifunctor (first)
import Data.Data (Data)
import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty as NE
import Data.Map (Map)
import qualified Data.Map as M
import Data.Maybe (listToMaybe)
import qualified Data.Set as S
import GHC.Generics (Generic)
import System.Directory (doesFileExist)
import System.FilePath (
replaceExtension,
Expand Down
4 changes: 2 additions & 2 deletions src/Disco/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ parseModule mode = do
defnGroups [] = []
defnGroups (d@DType {} : ds) = d : defnGroups ds
defnGroups (d@DTyDef {} : ds) = d : defnGroups ds
defnGroups (DDefn (TermDefn x bs) : ds)
= DDefn (TermDefn x (bs `NE.appendList` concatMap (\(TermDefn _ cs) -> NE.toList cs) grp))
defnGroups (DDefn (TermDefn x bs) : ds) =
DDefn (TermDefn x (bs `NE.appendList` concatMap (\(TermDefn _ cs) -> NE.toList cs) grp))
: defnGroups rest
where
(grp, rest) = matchDefn ds
Expand Down
2 changes: 1 addition & 1 deletion src/Disco/Pretty/Prec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Disco.Syntax.Operators
type Prec = Int

data PA = PA Prec BFixity
deriving (Show, Eq) -- Do NOT derive Ord, see note below.
deriving (Show, Eq) -- Do NOT derive Ord, see note below.

lowerPrec :: PA -> PA -> Bool
lowerPrec (PA p1 a1) (PA p2 a2) = p1 < p2 || (p1 == p2 && a1 /= a2)
Expand Down
6 changes: 3 additions & 3 deletions src/Disco/Typecheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ module Disco.Typecheck where

import Control.Arrow ((&&&))
import Control.Lens ((^..))
import Control.Monad (when, zipWithM, forM_, unless)
import Control.Monad (forM_, unless, when, zipWithM)
import Control.Monad.Trans.Maybe
import Data.Bifunctor (first)
import Data.Coerce
import qualified Data.Foldable as F
import Data.List (sort)
import Data.List.NonEmpty (NonEmpty(..))
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import Data.Map (Map)
import qualified Data.Map as M
Expand Down Expand Up @@ -309,7 +309,7 @@ checkDefn name (TermDefn x clauses) = mapError (LocTCError (Just (name .- x))) $
-- patterns don't match across different clauses
| otherwise = return ()

-- | Check a clause of a definition against a list of pattern types and a body type.
-- \| Check a clause of a definition against a list of pattern types and a body type.
checkClause ::
Members '[Reader TyCtx, Reader TyDefCtx, Writer Constraint, Error TCError, Fresh] r =>
[Type] ->
Expand Down
1 change: 0 additions & 1 deletion src/Disco/Typecheck/Solve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,6 @@ solveGraph vm g = atomToTypeSubst . unifyWCC <$> go topRelMap
if getSort vm v == S.fromList [QBool]
then Just (coerce v |-> B)
else -- Debug.trace (show v ++ " has no sub- or supertypes. Assuming N as a subtype.")

(coerce v |->)
<$> lubBySort
vm
Expand Down
2 changes: 1 addition & 1 deletion src/Disco/Typecheck/Unify.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module Disco.Typecheck.Unify where

import Unbound.Generics.LocallyNameless (Name, fv)

import Control.Monad (mzero)
import Control.Lens (anyOf)
import Control.Monad (mzero)
import Control.Monad.State
import qualified Data.Map as M
import Data.Set (Set)
Expand Down

0 comments on commit e6cdffc

Please sign in to comment.