Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromListPrefix :: forall (n :: Nat) a . SNatI n => [a] -> Maybe (Vec n a)vec Data.Vec.DataFamily.SpineStrict Convert list [a] to Vec n a. Returns Nothing if input list is too short.
>>> fromListPrefix "foo" :: Maybe (Vec N.Nat3 Char) Just ('f' ::: 'o' ::: 'o' ::: VNil)>>> fromListPrefix "quux" :: Maybe (Vec N.Nat3 Char) Just ('q' ::: 'u' ::: 'u' ::: VNil)>>> fromListPrefix "xy" :: Maybe (Vec N.Nat3 Char) Nothing
reifyList :: [a] -> (forall (n :: Nat) . SNatI n => Vec n a -> r) -> rvec Data.Vec.DataFamily.SpineStrict Reify any list [a] to Vec n a.
>>> reifyList "foo" length 3
toList :: forall (n :: Nat) a . SNatI n => Vec n a -> [a]vec Data.Vec.DataFamily.SpineStrict Convert Vec to list.
>>> toList $ 'f' ::: 'o' ::: 'o' ::: VNil "foo"
fromList :: forall (n :: Nat) a . SNatI n => [a] -> Maybe (Vec n a)vec Data.Vec.Lazy Convert list [a] to Vec n a. Returns Nothing if lengths don't match exactly.
>>> fromList "foo" :: Maybe (Vec N.Nat3 Char) Just ('f' ::: 'o' ::: 'o' ::: VNil)>>> fromList "quux" :: Maybe (Vec N.Nat3 Char) Nothing
>>> fromList "xy" :: Maybe (Vec N.Nat3 Char) Nothing
fromListPrefix :: forall (n :: Nat) a . SNatI n => [a] -> Maybe (Vec n a)vec Data.Vec.Lazy Convert list [a] to Vec n a. Returns Nothing if input list is too short.
>>> fromListPrefix "foo" :: Maybe (Vec N.Nat3 Char) Just ('f' ::: 'o' ::: 'o' ::: VNil)>>> fromListPrefix "quux" :: Maybe (Vec N.Nat3 Char) Just ('q' ::: 'u' ::: 'u' ::: VNil)>>> fromListPrefix "xy" :: Maybe (Vec N.Nat3 Char) Nothing
reifyList :: [a] -> (forall (n :: Nat) . SNatI n => Vec n a -> r) -> rvec Data.Vec.Lazy Reify any list [a] to Vec n a.
>>> reifyList "foo" length 3
toList :: forall (n :: Nat) a . Vec n a -> [a]vec Data.Vec.Lazy Convert Vec to list.
>>> toList $ 'f' ::: 'o' ::: 'o' ::: VNil "foo"
fromList :: forall (n :: Nat) a . SNatI n => [a] -> Maybe (Vec n a)vec Data.Vec.Lazy.Inline Convert list [a] to Vec n a. Returns Nothing if lengths don't match exactly.
>>> fromList "foo" :: Maybe (Vec N.Nat3 Char) Just ('f' ::: 'o' ::: 'o' ::: VNil)>>> fromList "quux" :: Maybe (Vec N.Nat3 Char) Nothing
>>> fromList "xy" :: Maybe (Vec N.Nat3 Char) Nothing
fromListPrefix :: forall (n :: Nat) a . SNatI n => [a] -> Maybe (Vec n a)vec Data.Vec.Lazy.Inline Convert list [a] to Vec n a. Returns Nothing if input list is too short.
>>> fromListPrefix "foo" :: Maybe (Vec N.Nat3 Char) Just ('f' ::: 'o' ::: 'o' ::: VNil)>>> fromListPrefix "quux" :: Maybe (Vec N.Nat3 Char) Just ('q' ::: 'u' ::: 'u' ::: VNil)>>> fromListPrefix "xy" :: Maybe (Vec N.Nat3 Char) Nothing
reifyList :: [a] -> (forall (n :: Nat) . SNatI n => Vec n a -> r) -> rvec Data.Vec.Lazy.Inline Reify any list [a] to Vec n a.
>>> reifyList "foo" length 3