From 134d97365e69cc2d1d04b72fb4d9a66c25c45991 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Thu, 17 Mar 2022 16:09:16 +0200 Subject: [PATCH] Uses Set fromFoldable --- spago.dhall | 1 + src/Data/Row/Options.purs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index 20d9555..07a94a1 100644 --- a/spago.dhall +++ b/spago.dhall @@ -19,6 +19,7 @@ to generate this file without the comments in this block. , "homogeneous" , "lists" , "maybe" + , "ordered-collections" , "partial" , "prelude" , "record" diff --git a/src/Data/Row/Options.purs b/src/Data/Row/Options.purs index ee3cec9..2f679e2 100644 --- a/src/Data/Row/Options.purs +++ b/src/Data/Row/Options.purs @@ -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) @@ -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 \ No newline at end of file +feelingLucky ro = if fromFoldable (rowListKeys (Proxy :: _ rl1)) == fromFoldable (unsafeKeys ro) then Just (unsafeCoerce ro) else Nothing \ No newline at end of file