module Mind ( NeuronIndex (..) , getNeuronIndex , Edge (..) , Network (..) , createEmptyNetwork ) where -- index different neuron types data NeuronIndex = Input Int | Internal Int | Output Int deriving (Show, Eq) getNeuronIndex :: NeuronIndex -> Int getNeuronIndex (Input i) = i getNeuronIndex (Internal i) = i getNeuronIndex (Output i) = i -- define incident edges newtype Edge = Edge (NeuronIndex, Float) deriving (Show, Eq) -- define networks data Network = Network { numInput :: Int , internalNeurons :: [[Edge]] , outputNeurons :: [[Edge]] } deriving (Show, Eq) createEmptyNetwork :: Int -> Int -> Int -> Network createEmptyNetwork i h o = Network i (replicate h []) (replicate o [])