Skip to content

Commit

Permalink
Use fromMaybe instead of maybe where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kariiem authored and sgraf812 committed Oct 2, 2024
1 parent 1757fe6 commit db7e413
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tabular/src/Happy/Tabular/First.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Implementation of FIRST
> import Happy.Tabular.NameSet ( NameSet )
> import qualified Happy.Tabular.NameSet as Set
> import Happy.Grammar
> import Data.Maybe (fromMaybe)

\subsection{Utilities}

Expand Down Expand Up @@ -36,7 +37,7 @@ This will never terminate.
> , lookupProdsOfName = prodsOfName
> , non_terminals = nts
> })
> = joinSymSets (\ h -> maybe (Set.singleton h) id (lookup h env) )
> = joinSymSets (\h ->fromMaybe (Set.singleton h) (lookup h env))
> where
> env = mkClosure (==) (updateFirstSets fst_term prodNo prodsOfName) [(name,Set.empty) | name <- nts]

Expand Down

0 comments on commit db7e413

Please sign in to comment.