@@ -0,0 +1,86 @@
1+--------------------------------------------------------------------------------
3+module Hakyll.Web.Template.Canonicalize
8+--------------------------------------------------------------------------------
9+import Hakyll.Web.Template.Internal
12+--------------------------------------------------------------------------------
14+-- Some initial implementation notes. Note: Not valid syntax etc.
18+-- [TrimL, t, TrimR] = [t]
24+-- [t1, TrimR, TrimR, t2] = [t1, TrimR, t2]
26+-- [t1, TrimL, TrimL, t2] = [t1, TrimL, t2]
30+-- [t1, TrimR, If ex [TrimR, t] e, t2] = [t1, If ex [TrimR, t] e, t2]
32+-- [t1, If ex t [e, TrimL], TrimL, t2] = [t1, If ex t [e, TrimL], t2]
34+-- [t1, If ex [t, TrimL] Nothing, TrimL, t2] = [t1, If ex [t, TrimL] Nothing, t2]
38+-- [t1, TrimR, For e [TrimR, b] sep, t2] = [t1, For e [TrimR, b] sep, t2]
40+-- [t1, For e b [sep, TrimL], TrimL, t2] = [t1, For e b [sep, TrimL], t2]
42+-- [t1, For e [b, TrimL] Nothing, TrimL, t2] = [t1, For e [b, TrimL] Nothing, t2]
49+-- [t1, TrimR, If ex t e, t2] = [t1, If ex [TrimR, t] e, t2]
51+-- [t1, If ex t e, TrimL, t2] = if isJust e
52+-- then [t1, If ex t [e, TrimL], t2]
53+-- else [t1, If ex [t, TrimL] e, t2]
57+-- [t1, TrimR, For e b sep, t2] = [t1, For e [TrimR, b] sep, t2]
59+-- [t1, For e b sep, TrimL, t2] = if isJust sep
60+-- then [t1, For e b [sep, TrimL], t2]
61+-- else [t1, For e [b, TrimL] sep, t2]
68+-- If ex [t1, TrimR] (Just e) = If ex t1 [TrimR, e]
70+-- If ex [t1, TrimR] Nothing = [If ex t1 Nothing, TrimR]
72+-- If ex t [TrimL, e] = If ex [t, TrimL] e
77+-- For e [t1, TrimR] (Just sep) = For e t1 [TrimR, sep]
79+-- For e [t1, TrimR] Nothing = For e t1 [TrimR, sep]
81+-- For e b [TrimL, sep] = For e [b, TrimL] sep
85+canonicalize :: Template -> Template
86+canonicalize = undefined