Created
May 21, 2017 13:27
-
-
Save pakoito/00db608857b0a96ea8829387f1a5c785 to your computer and use it in GitHub Desktop.
Kind ECS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
data family Component a :: * | |
data instance Component Health = HealthC | |
data instance Component Stamina = StaminaC | |
newtype Health = | |
Health Int | |
deriving (Show) | |
newtype Stamina = | |
Stamina Int | |
deriving (Show) | |
components :: Component a -> [a] | |
components a = [] | |
addComponent :: Component a -> a -> [a] | |
addComponent t a = [a] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment