Skip to content

Commit

Permalink
Uses Set fromFoldable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Solomon committed Mar 17, 2022
1 parent 6219c3a commit 134d973
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ to generate this file without the comments in this block.
, "homogeneous"
, "lists"
, "maybe"
, "ordered-collections"
, "partial"
, "prelude"
, "record"
Expand Down
3 changes: 2 additions & 1 deletion src/Data/Row/Options.purs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import Prelude

import Data.Function.Uncurried (runFn2)
import Data.Maybe (Maybe(..))
import Data.Set (fromFoldable)
import Data.Symbol (class IsSymbol, reflectSymbol)
import Heterogeneous.Mapping (class HMap, class HMapWithIndex, class MappingWithIndex, ConstMapping(..), mappingWithIndex)
import Prim.Row (class Cons, class Lacks, class Nub, class Union)
Expand Down Expand Up @@ -427,4 +428,4 @@ instance rowListKeysCons :: (IsSymbol sym, RowListKeys rest) => RowListKeys (RL.
rowListKeys _ = [ reflectSymbol (Proxy :: _ sym) ] <> rowListKeys (Proxy :: _ rest)

feelingLucky :: forall r1 rl1 r2 r3. Union r1 r2 r3 => RL.RowToList r1 rl1 => RowListKeys rl1 => RowOptions r3 -> Maybe { | r1 }
feelingLucky ro = if rowListKeys (Proxy :: _ rl1) == unsafeKeys ro then Just (unsafeCoerce ro) else Nothing
feelingLucky ro = if fromFoldable (rowListKeys (Proxy :: _ rl1)) == fromFoldable (unsafeKeys ro) then Just (unsafeCoerce ro) else Nothing

0 comments on commit 134d973

Please sign in to comment.