typesafe-precure 0.2.0.0 → 0.3.0.0
raw patch · 7 files changed
+196/−21 lines, 7 filesdep +autoexporterdep +th-data-compat
Dependencies added: autoexporter, th-data-compat
Files
- src/ACME/PreCure/Textbook.hs +2/−18
- src/ACME/PreCure/Textbook/KirakiraALaMode.hs +2/−0
- src/ACME/PreCure/Textbook/KirakiraALaMode/Instances.hs +80/−0
- src/ACME/PreCure/Textbook/KirakiraALaMode/Types.hs +30/−0
- src/ACME/PreCure/Textbook/KirakiraALaMode/Words.hs +18/−0
- src/ACME/PreCure/Types/TH.hs +55/−1
- typesafe-precure.cabal +9/−2
src/ACME/PreCure/Textbook.hs view
@@ -1,18 +1,2 @@-module ACME.PreCure.Textbook- ( module T- ) where---import ACME.PreCure.Textbook.First as T-import ACME.PreCure.Textbook.MaxHeart as T-import ACME.PreCure.Textbook.SplashStar as T-import ACME.PreCure.Textbook.Yes5 as T-import ACME.PreCure.Textbook.Yes5GoGo as T-import ACME.PreCure.Textbook.Fresh as T-import ACME.PreCure.Textbook.HeartCatch as T-import ACME.PreCure.Textbook.Suite as T-import ACME.PreCure.Textbook.Smile as T-import ACME.PreCure.Textbook.Dokidoki as T-import ACME.PreCure.Textbook.HappinessCharge as T-import ACME.PreCure.Textbook.GoPrincess as T-import ACME.PreCure.Textbook.MahoGirls as T+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -F -pgmF autoexporter #-}
+ src/ACME/PreCure/Textbook/KirakiraALaMode.hs view
@@ -0,0 +1,2 @@+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -F -pgmF autoexporter #-}
+ src/ACME/PreCure/Textbook/KirakiraALaMode/Instances.hs view
@@ -0,0 +1,80 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeFamilies #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++module ACME.PreCure.Textbook.KirakiraALaMode.Instances where+++import ACME.PreCure.Types.TH++import ACME.PreCure.Textbook.KirakiraALaMode.Types+import ACME.PreCure.Textbook.KirakiraALaMode.Words+++transformationInstance [t| Ichika |] [t| SweetsPact RabbitShortcake |] [t| CureWhip |] [| CureWhip |] (cureALaModeDecoration : introducesHerselfAs_CureWhip)+transformationInstance [t| Himari |] [t| SweetsPact SquirrelPudding |] [t| CureCustard |] [| CureCustard |] (cureALaModeDecoration : introducesHerselfAs_CureCustard)+transformationInstance [t| Aoi |] [t| SweetsPact LionIce |] [t| CureGelato |] [| CureGelato |] (cureALaModeDecoration : introducesHerselfAs_CureGelato)+transformationInstance [t| Yukari |] [t| SweetsPact CatMacaron |] [t| CureMacaron |] [| CureMacaron |] (cureALaModeDecoration : introducesHerselfAs_CureMacaron)+transformationInstance [t| Akira |] [t| SweetsPact DogChocolate |] [t| CureChocolat |] [| CureChocolat |] (cureALaModeDecoration : introducesHerselfAs_CureChocolat)++transformationInstance+ [t| (Ichika, Himari, Aoi, Yukari, Akira) |]+ [t| (SweetsPact RabbitShortcake, SweetsPact SquirrelPudding, SweetsPact LionIce, SweetsPact CatMacaron, SweetsPact DogChocolate) |]+ [t| (CureWhip, CureCustard, CureGelato, CureMacaron, CureChocolat) |]+ [| (CureWhip, CureCustard, CureGelato, CureMacaron, CureChocolat) |]+ ( kirakiraALaModeTransformationSpeech+ [ introducesHerselfAs_CureWhip+ , introducesHerselfAs_CureCustard+ , introducesHerselfAs_CureGelato+ , introducesHerselfAs_CureMacaron+ , introducesHerselfAs_CureChocolat+ ]+ ++ [groupName_KirakiraALaMode ++ "!"]+ )++transformationInstance+ [t| (Ichika, Himari, Aoi) |]+ [t| (SweetsPact RabbitShortcake, SweetsPact SquirrelPudding, SweetsPact LionIce) |]+ [t| (CureWhip, CureCustard, CureGelato) |]+ [| (CureWhip, CureCustard, CureGelato) |]+ ( kirakiraALaModeTransformationSpeech+ [ introducesHerselfAs_CureWhip+ , introducesHerselfAs_CureCustard+ , introducesHerselfAs_CureGelato+ ]+ )++transformationInstance+ [t| (Ichika, Himari, Aoi, Yukari) |]+ [t| (SweetsPact RabbitShortcake, SweetsPact SquirrelPudding, SweetsPact LionIce, SweetsPact CatMacaron) |]+ [t| (CureWhip, CureCustard, CureGelato, CureMacaron) |]+ [| (CureWhip, CureCustard, CureGelato, CureMacaron) |]+ ( kirakiraALaModeTransformationSpeech+ [ introducesHerselfAs_CureWhip+ , introducesHerselfAs_CureCustard+ , introducesHerselfAs_CureGelato+ , introducesHerselfAs_CureMacaron+ ]+ )++transformationInstance+ [t| (Yukari, Akira) |]+ [t| (SweetsPact CatMacaron, SweetsPact DogChocolate) |]+ [t| (CureMacaron, CureChocolat) |]+ [| (CureMacaron, CureChocolat) |]+ ( kirakiraALaModeTransformationSpeech+ [ introducesHerselfAs_CureMacaron+ , introducesHerselfAs_CureChocolat+ ]+ )+++purificationInstance+ [t| (CureWhip, CureCustard, CureGelato, CureMacaron, CureChocolat) |]+ [t| CandyRod |]+ [ "キャンディーロッド!"+ , "キラキラキラル・フルチャージ!"+ , "スイー・ツー・ワンダフル・アラモード!"+ ]
+ src/ACME/PreCure/Textbook/KirakiraALaMode/Types.hs view
@@ -0,0 +1,30 @@+{-# LANGUAGE TemplateHaskell #-}++module ACME.PreCure.Textbook.KirakiraALaMode.Types where++import ACME.PreCure.Types.TH++import ACME.PreCure.Textbook.KirakiraALaMode.Words+++defineGirl "Ichika" "宇佐美 いちか"+defineGirl "Himari" "有栖川 ひまり"+defineGirl "Aoi" "立神 あおい"+defineGirl "Yukari" "琴爪 ゆかり"+defineGirl "Akira" "剣城 あきら"++defineTransformedDefault "CureWhip" "キュアホイップ" $ concat introducesHerselfAs_CureWhip+defineTransformedDefault "CureCustard" "キュアカスタード" $ concat introducesHerselfAs_CureCustard+defineTransformedDefault "CureGelato" "キュアジェラート" $ concat introducesHerselfAs_CureGelato+defineTransformedDefault "CureMacaron" "キュアマカロン" $ concat introducesHerselfAs_CureMacaron+defineTransformedDefault "CureChocolat" "キュアショコラ" $ concat introducesHerselfAs_CureChocolat++data SweetsPact s = SweetsPact s++define "RabbitShortcake"+define "SquirrelPudding"+define "LionIce"+define "CatMacaron"+define "DogChocolate"++define "CandyRod"
+ src/ACME/PreCure/Textbook/KirakiraALaMode/Words.hs view
@@ -0,0 +1,18 @@+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}++module ACME.PreCure.Textbook.KirakiraALaMode.Words where++groupName_KirakiraALaMode = "キラキラ☆プリキュアアラモード"++cureALaModeDecoration = "キュアラモード・デコレーション!"++introducesHerselfAs_CureWhip = ["ショートケーキ!", "元気と笑顔を!", "レッツ・ラ・まぜまぜ!", "キュアホイップ!できあがり!"]+introducesHerselfAs_CureCustard = ["プリン!", "知性と勇気を!", "レッツ・ラ・まぜまぜ!", "キュアカスタード!できあがり!"]+introducesHerselfAs_CureGelato = ["アイス!", "自由と情熱を!", "レッツ・ラ・まぜまぜ!", "キュアジェラート!できあがり!"]+introducesHerselfAs_CureMacaron = ["マカロン!", "美しさとトキメキを!", "レッツ・ラ・まぜまぜ!", "キュアマカロン!できあがり!"]+introducesHerselfAs_CureChocolat = ["チョコレート!", "強さと愛を!", "レッツ・ラ・まぜまぜ!", "キュアショコラ!できあがり!"]++kirakiraALaModeTransformationSpeech :: [[String]] -> [String]+kirakiraALaModeTransformationSpeech [] = error "No transforamation speech given!"+kirakiraALaModeTransformationSpeech al@(first:_) =+ cureALaModeDecoration : init first ++ map last al
src/ACME/PreCure/Types/TH.hs view
@@ -1,17 +1,71 @@ {-# LANGUAGE TemplateHaskell #-} -module ACME.PreCure.Types.TH where+module ACME.PreCure.Types.TH+ ( define+ , defineGirl+ , defineTransformed+ , defineTransformedDefault + , girlInstance+ , transformedInstance+ , transformedInstanceDefault+ , transformedGroupInstance+ , transformedGroupInstanceDefault+ , transformationInstance + , purificationInstance+ , nonItemPurificationInstance+ ) where++ import ACME.PreCure.Types +import Language.Haskell.TH+ ( Name+ , conT+ , mkName+ )+import Language.Haskell.TH.Compat.Data+ ( dataD'+ ) import Language.Haskell.TH.Lib ( DecsQ+ , DecQ , ExpQ , TypeQ+ , cxt , listE+ , normalC , stringE )++singletonDataD :: Name -> DecQ+singletonDataD name =+ dataD' (cxt []) name [] [normalC name []] [''Show, ''Eq]+++define :: String -> DecsQ+define string = (:[]) <$> singletonDataD (mkName string)+++defineWith :: Name -> DecsQ -> DecsQ+defineWith name decsq = (:) <$> singletonDataD name <*> decsq+++defineGirl :: String -> String -> DecsQ+defineGirl string humanN = do+ let name = mkName string+ defineWith name $ girlInstance (conT name) humanN+++defineTransformed :: String -> String -> String -> String -> DecsQ+defineTransformed string cureN intro vari = do+ let name = mkName string+ defineWith name $ transformedInstance (conT name) cureN intro vari+++defineTransformedDefault :: String -> String -> String -> DecsQ+defineTransformedDefault string cureN intro = defineTransformed string cureN intro "" girlInstance :: TypeQ -> String -> DecsQ
typesafe-precure.cabal view
@@ -1,5 +1,5 @@ name: typesafe-precure-version: 0.2.0.0+version: 0.3.0.0 synopsis: Type-safe transformations and purifications of PreCures (Japanese Battle Heroine) description: See README.md for details. homepage: https://github.com/igrep/typesafe-precure#readme@@ -7,7 +7,7 @@ license-file: LICENSE author: Yuji Yamamoto maintainer: whosekiteneverfly@gmail.com-copyright: 2016 Yuji Yamamoto+copyright: 2017 Yuji Yamamoto category: ACME build-type: Simple -- extra-source-files:@@ -75,14 +75,21 @@ , ACME.PreCure.Textbook.MahoGirls.Types , ACME.PreCure.Textbook.MahoGirls.Words + , ACME.PreCure.Textbook.KirakiraALaMode+ , ACME.PreCure.Types , ACME.PreCure.Monad other-modules: ACME.PreCure.Types.TH+ , ACME.PreCure.Textbook.KirakiraALaMode.Instances+ , ACME.PreCure.Textbook.KirakiraALaMode.Types+ , ACME.PreCure.Textbook.KirakiraALaMode.Words build-depends: base >= 4.7 && < 5 -- TODO: specify version+ , autoexporter , monad-skeleton , dlist , template-haskell+ , th-data-compat default-language: Haskell2010 test-suite typesafe-precure-test