neural-0.3.0.0: Neural Networks in native Haskell

Copyright(c) Lars Brünjes, 2016
LicenseMIT
Maintainerbrunjlar@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Utils.Traversable

Description

This module contains utility functions related to the Traversable typeclass.

Synopsis

Documentation

fromList :: (Applicative t, Traversable t) => [a] -> Maybe (t a) Source #

Tries to create a traversable (which must also be applicative) from a list. If the list contains too few elements, Nothing is returned,

>>> import Data.MyPrelude
>>> fromList [1, 2, 3] :: Maybe (Identity Int)
Just (Identity 1)
>>> fromList [] :: Maybe (Identity Char)
Nothing