{-# LANGUAGE DataKinds          #-}
{-# LANGUAGE ImpredicativeTypes #-}
module DECENTRAL_EE.Website where

data Principle = SoundMoney | OpenTech | SelfSovereignty

data DecentralizedF (p :: Principle) next where
  Bitcoin         :: a -> DecentralizedF SoundMoney      a
  Gold            :: a -> DecentralizedF SoundMoney      a
  OpenSource      :: a -> DecentralizedF OpenTech        a
  PrivacyByDesign :: a -> DecentralizedF OpenTech        a
  W3C_DID         :: a -> DecentralizedF SelfSovereignty a
  DAO             :: a -> DecentralizedF SelfSovereignty a

type ADecentralizedFuture = Fix (DecentralizedF (forall (a :: Principle). a))

aDecentralizedFuture :: IO ADecentralizedFuture
aDecentralizedFuture = undefined -- TO BE DONE

main = aDecentralizedFuture >>= isBuiltAt
  MkContact { businessName       = "DECENTRAL.EE OÜ"
            , businessAddress    = "Pärnu mnt 110-117, Tallinn, Estonia"
            , businessEmail      = "info@decentral.ee"
            , businessPhone      = "+372 54652482"
            , registrationNumber = "14482250"
            , vatNumber          = "EE102067556"
            }

newtype Fix f = Fix { unFix :: f (Fix f) }

data Contact = MkContact { businessName       :: String
                         , businessAddress    :: String
                         , businessEmail      :: String
                         , businessPhone      :: String
                         , registrationNumber :: String
                         , vatNumber          :: String
                         }

isBuiltAt :: Monad m => Contact -> Fix f -> m (f (Fix f))
isBuiltAt = const (return . unFix)