Skip to content

Instantly share code, notes, and snippets.

@jackwillis
Last active September 14, 2017 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackwillis/78340b550bf55c5d26ecadcc80cbe3ea to your computer and use it in GitHub Desktop.
Save jackwillis/78340b550bf55c5d26ecadcc80cbe3ea to your computer and use it in GitHub Desktop.
External anatomy of a flower using algebraic data types
module Flower where
-- there's probably mistakes in here, also it is not a serious model of the flower
data Pedicel = Pedicel
data Tepal = Tepal
data Sepal = Sepal
data Petal = Petal
data Perigonium = Perigonium [Tepal]
data Calyx = Calyx [Sepal]
data Corolla = Corolla [Petal]
data SingleOuterWhorl = SOWP Perigonium | SOWCA Calyx | SOWCO Corolla
data Perianth = Achlamydeous | Monochlamydeous SingleOuterWhorl | Dichlamydeous Calyx Corolla
data Filament = Filament
data Anther = Anther
data Stamen = Stamen Filament Anther
data Androecium = Androecium [Stamen]
data Ovule = Ovule
data Ovary = Ovary [Ovule]
data Style = Style
data Stigma = Stigma
data Pistil = Pistil Ovary Style Stigma
data SimpleCarpel = SimpleCarpel Pistil
data CompoundCarpel = CompoundCarpel [Pistil]
data Carpel = SC SimpleCarpel | CC CompoundCarpel
data Gynoecium = Monocarpus SimpleCarpel | Apocarpous [SimpleCarpel] | Syncarpous [CompoundCarpel]
data Flower = Flower Pedicel Perianth Androecium Gynoecium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment