Skip to content

Commit 383b803

Browse files
Clean up formatting
1 parent cf6f606 commit 383b803

30 files changed

Lines changed: 254 additions & 222 deletions

examples/Example/Halogen/ComponentsInputs/Container.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ component = Hooks.component \_ _ -> Hooks.do
3232
]
3333
, HH.button
3434
[ HE.onClick \_ -> decrement ]
35-
[ HH.text "- 1"]
35+
[ HH.text "- 1" ]
3636
, HH.button
3737
[ HE.onClick \_ -> increment ]
38-
[ HH.text "+ 1"]
38+
[ HH.text "+ 1" ]
3939
]

examples/Example/Hooks/Components.purs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ previousValue = Hooks.component \_ _ -> Hooks.do
3636
prevState <- usePrevious state
3737

3838
Hooks.pure do
39-
HH.div
40-
[ ]
39+
HH.div_
4140
[ HH.h4_ [ HH.text "Previous Value" ]
4241
, HH.p_ [ HH.text "This example demonstrates a hook to persist a value from the previous render." ]
4342
, HH.text $ "The previous value of the state 'count' was: " <> show prevState
@@ -64,8 +63,7 @@ localStorage = Hooks.component \_ _ -> Hooks.do
6463
modifyState (over _Right (_ + 1))
6564

6665
Hooks.pure do
67-
HH.div
68-
[ ]
66+
HH.div_
6967
[ HH.text "Click on the button to clear from local storage"
7068
, HH.button
7169
[ HE.onClick \_ -> clearCount ]

examples/Example/Hooks/UseDebouncer.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Example.Hooks.UseDebouncer
22
( useDebouncer
33
, UseDebouncer
4-
)
5-
where
4+
) where
65

76
import Prelude
87

@@ -22,7 +21,7 @@ foreign import data UseDebouncer :: Type -> Hooks.HookType
2221

2322
type UseDebouncer' a = UseRef (Maybe Debouncer) <> UseRef (Maybe a) <> Hooks.Pure
2423

25-
instance newtypeUseDebouncer :: HookNewtype (UseDebouncer a) (UseDebouncer' a)
24+
instance HookNewtype (UseDebouncer a) (UseDebouncer' a)
2625

2726
type Debouncer = { var :: AVar Unit, fiber :: Fiber Unit }
2827

examples/Example/Hooks/UseInitializer.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Example.Hooks.UseInitializer
22
( useInitializer
33
, UseInitializer
4-
)
5-
where
4+
) where
65

76
import Prelude
87

@@ -12,7 +11,7 @@ import Halogen.Hooks as Hooks
1211

1312
foreign import data UseInitializer :: Hooks.HookType
1413

15-
instance hookUseInitializer :: HookNewtype UseInitializer UseEffect
14+
instance HookNewtype UseInitializer UseEffect
1615

1716
useInitializer :: forall m. HookM m Unit -> Hook m UseInitializer Unit
1817
useInitializer initializer = Hooks.wrap hook

examples/Example/Hooks/UseLocalStorage.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ module Example.Hooks.UseLocalStorage
33
, UseLocalStorage
44
, Key(..)
55
, StorageInterface
6-
)
7-
where
6+
) where
87

98
import Prelude
109

@@ -30,7 +29,7 @@ type UseLocalStorage' a =
3029
<> UseEffect
3130
<> Hooks.Pure
3231

33-
instance newtypeUseLocalStorage :: HookNewtype (UseLocalStorage a) h
32+
instance HookNewtype (UseLocalStorage a) h
3433

3534
type StorageInterface a =
3635
{ key :: Key
@@ -42,7 +41,7 @@ type StorageInterface a =
4241
-- | A key for a cell in local storage
4342
newtype Key = Key String
4443

45-
derive newtype instance eqKey :: Eq Key
44+
derive newtype instance Eq Key
4645

4746
useLocalStorage
4847
:: forall m a

examples/Example/Hooks/UsePrevious.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Example.Hooks.UsePrevious
22
( usePrevious
33
, UsePrevious
4-
)
5-
where
4+
) where
65

76
import Prelude
87

@@ -18,7 +17,7 @@ foreign import data UsePrevious :: Type -> Hooks.HookType
1817

1918
type UsePrevious' a = UseRef (Maybe a) <> UseEffect <> Hooks.Pure
2019

21-
instance newtypeUsePrevious :: HookNewtype (UsePrevious a) (UsePrevious' a)
20+
instance HookNewtype (UsePrevious a) (UsePrevious' a)
2221

2322
usePrevious :: forall m a. MonadAff m => Eq a => a -> Hook m (UsePrevious a) (Maybe a)
2423
usePrevious value = Hooks.wrap hook
@@ -27,7 +26,7 @@ usePrevious value = Hooks.wrap hook
2726
hook = Hooks.do
2827
prev /\ ref <- Hooks.useRef Nothing
2928

30-
Hooks.captures { } Hooks.useTickEffect do
29+
Hooks.captures {} Hooks.useTickEffect do
3130
liftEffect $ Ref.write (Just value) ref
3231
pure Nothing
3332

examples/Example/Hooks/UseWindowWidth.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Example.Hooks.UseWindowWidth
22
( useWindowWidth
33
, UseWindowWidth
4-
)
5-
where
4+
) where
65

76
import Prelude
87

@@ -23,7 +22,7 @@ foreign import data UseWindowWidth :: Hooks.HookType
2322

2423
type UseWindowWidth' = UseState (Maybe Int) <> UseEffect <> Hooks.Pure
2524

26-
instance newtypeUseWindowWidth :: HookNewtype UseWindowWidth UseWindowWidth'
25+
instance HookNewtype UseWindowWidth UseWindowWidth'
2726

2827
useWindowWidth :: forall m. MonadAff m => Hook m UseWindowWidth (Maybe Int)
2928
useWindowWidth = Hooks.wrap hook

examples/Example/Main.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ examples =
5454
index = Hooks.component \_ _ -> Hooks.pure do
5555
HH.div_
5656
[ HH.h1_
57-
[ HH.text "Halogen Hooks" ]
57+
[ HH.text "Halogen Hooks" ]
5858
, HH.p_
59-
[ HH.text "See the Halogen Hooks "
60-
, HH.a
61-
[ HP.href "https://github.com/thomashoneyman/purescript-halogen-hooks" ]
62-
[ HH.text "README" ]
63-
, HH.text " for details."
64-
]
59+
[ HH.text "See the Halogen Hooks "
60+
, HH.a
61+
[ HP.href "https://github.com/thomashoneyman/purescript-halogen-hooks" ]
62+
[ HH.text "README" ]
63+
, HH.text " for details."
64+
]
6565
]

examples/examples.dhall

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ in conf //
33
{ dependencies =
44
conf.dependencies #
55
[ "argonaut"
6-
, "console"
7-
, "debug"
6+
, "avar"
7+
, "datetime"
88
, "effect"
9+
, "either"
910
, "halogen-storybook"
10-
, "psci-support"
11+
, "profunctor-lenses"
1112
, "random"
13+
, "web-events"
14+
, "web-storage"
1215
]
1316
, sources =
1417
conf.sources #

spago.dhall

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
{ name = "halogen-hooks"
22
, license = "MIT"
33
, repository = "https://github.com/thomashoneyman/purescript-halogen-hooks"
4-
, dependencies = [ "halogen" ]
4+
, dependencies =
5+
[ "aff"
6+
, "arrays"
7+
, "bifunctors"
8+
, "effect"
9+
, "exceptions"
10+
, "foldable-traversable"
11+
, "foreign-object"
12+
, "free"
13+
, "freeap"
14+
, "halogen"
15+
, "halogen-subscriptions"
16+
, "maybe"
17+
, "newtype"
18+
, "ordered-collections"
19+
, "parallel"
20+
, "partial"
21+
, "prelude"
22+
, "refs"
23+
, "tailrec"
24+
, "transformers"
25+
, "tuples"
26+
, "unsafe-coerce"
27+
, "unsafe-reference"
28+
, "web-dom"
29+
, "web-html"
30+
]
531
, packages = ./packages.dhall
632
, sources = [ "src/**/*.purs" ]
733
}

0 commit comments

Comments
 (0)