git.iko.soy/rowtype-yoga/purescm
on bytevector help sign in
Define snapshot for prime characters
commita37dd851d9041170d346a4ba9fdddbef254ad8d6 authorJordan Martinez <jordanalex.martinez@protonmail.com> dateMon 3 Apr 2023, 16:35 (4 years ago) parent3840ec9
1 file changed+76
test-snapshots/src/snapshots-input/Snapshot.Prime.purs+76
test-snapshots/src/snapshots-input/Snapshot.Prime.pursnew file+76
@@ -0,0 +1,76 @@
1+module Snapshot.Prime where
2+
3+import Data.Semigroup ((<>))
4+
5+foo :: String
6+foo = "foo"
7+
8+-- declarations ending in prime shouldn't cause issues
9+foo' :: String
10+foo' = "foo'"
11+
12+-- declarations ending in prime shouldn't cause issues
13+foo'' :: String
14+foo'' = "foo'"
15+
16+foo'oo :: String
17+foo'oo = "foo'oo"
18+
19+data DataType' = DCtor
20+
21+data DataCtor = Ctor' String Int
22+
23+newtype NewtypeType' = NCtor Int
24+
25+newtype NewtypeCtor = NewtypeCtor' Int
26+
27+class ClassName' a where
28+ ignore :: a -> String
29+
30+class ClassMember a where
31+ classMember' :: a -> String
32+
33+data Foo
34+ = F1
35+ | F2
36+
37+class Normal a where
38+ normal :: a -> String
39+
40+instance instanceName' :: Normal Foo where
41+ normal = case _ of
42+ F1 -> "F1"
43+ F2 -> "F2"
44+
45+useFooPrime1 :: String
46+useFooPrime1 = foo'
47+
48+useFooPrime2 :: String
49+useFooPrime2 = foo''
50+
51+useFooPrime3 :: String
52+useFooPrime3 = foo'oo
53+
54+useDataType :: String -> DataType'
55+useDataType _ = DCtor
56+
57+useDataCtor :: String -> DataCtor
58+useDataCtor s = Ctor' s 4
59+
60+useNewtypeType :: Int -> NewtypeType'
61+useNewtypeType i = NCtor i
62+
63+useNewtypeCtor :: Int -> NewtypeCtor
64+useNewtypeCtor i = NewtypeCtor' i
65+
66+useClass :: forall a. ClassName' a => a -> String
67+useClass x = ignore x
68+
69+useMember :: forall a. ClassMember a => a -> String
70+useMember x = classMember' x
71+
72+useNormal :: forall a b. Normal a => Normal b => a -> b -> String
73+useNormal a b = normal a <> normal b
74+
75+useInstance :: String
76+useInstance = useNormal F1 F2