Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit fc1b235

Browse files
committed
Generalize fromExceptions.
1 parent 801144c commit fc1b235

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

semantic-analysis/src/Analysis/Exception.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Analysis.Effect.Domain
1818
import Analysis.Name
1919
import Control.Algebra
2020
import Control.Applicative (Alternative (..))
21+
import qualified Data.Foldable as Foldable
2122
import qualified Data.Set as Set
2223

2324
newtype Exception = Exception { exceptionName :: String }
@@ -33,8 +34,8 @@ instance Semigroup ExcSet where
3334
instance Monoid ExcSet where
3435
mempty = ExcSet mempty mempty
3536

36-
fromExceptions :: [Exception] -> ExcSet
37-
fromExceptions = ExcSet mempty . Set.fromList
37+
fromExceptions :: Foldable t => t Exception -> ExcSet
38+
fromExceptions = ExcSet mempty . Set.fromList . Foldable.toList
3839

3940
var :: Name -> ExcSet
4041
var v = ExcSet (Set.singleton v) mempty

0 commit comments

Comments
 (0)