|
| 1 | +# Module Documentation |
| 2 | + |
| 3 | +## Module Routing |
| 4 | + |
| 5 | +#### `hashChanged` |
| 6 | + |
| 7 | +``` purescript |
| 8 | +hashChanged :: forall e. (String -> String -> Eff e Unit) -> Eff e Unit |
| 9 | +``` |
| 10 | + |
| 11 | + |
| 12 | +#### `hashes` |
| 13 | + |
| 14 | +``` purescript |
| 15 | +hashes :: forall e. (String -> String -> Eff e Unit) -> Eff e Unit |
| 16 | +``` |
| 17 | + |
| 18 | + |
| 19 | +#### `matches` |
| 20 | + |
| 21 | +``` purescript |
| 22 | +matches :: forall e a. Match a -> (Maybe a -> a -> Eff e Unit) -> Eff e Unit |
| 23 | +``` |
| 24 | + |
| 25 | + |
| 26 | +#### `matchHash` |
| 27 | + |
| 28 | +``` purescript |
| 29 | +matchHash :: forall a. Match a -> String -> Either String a |
| 30 | +``` |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +## Module Routing.Match |
| 35 | + |
| 36 | +#### `Match` |
| 37 | + |
| 38 | +``` purescript |
| 39 | +newtype Match a |
| 40 | + = Match (Route -> Either String (Tuple Route a)) |
| 41 | +``` |
| 42 | + |
| 43 | + |
| 44 | +#### `matchMatchClass` |
| 45 | + |
| 46 | +``` purescript |
| 47 | +instance matchMatchClass :: MatchClass Match |
| 48 | +``` |
| 49 | + |
| 50 | + |
| 51 | +#### `matchFunctor` |
| 52 | + |
| 53 | +``` purescript |
| 54 | +instance matchFunctor :: Functor Match |
| 55 | +``` |
| 56 | + |
| 57 | + |
| 58 | +#### `matchAlt` |
| 59 | + |
| 60 | +``` purescript |
| 61 | +instance matchAlt :: Alt Match |
| 62 | +``` |
| 63 | + |
| 64 | + |
| 65 | +#### `matchPlus` |
| 66 | + |
| 67 | +``` purescript |
| 68 | +instance matchPlus :: Plus Match |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | +#### `matchAlternative` |
| 73 | + |
| 74 | +``` purescript |
| 75 | +instance matchAlternative :: Alternative Match |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | +#### `matchApply` |
| 80 | + |
| 81 | +``` purescript |
| 82 | +instance matchApply :: Apply Match |
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | +#### `matchApplicative` |
| 87 | + |
| 88 | +``` purescript |
| 89 | +instance matchApplicative :: Applicative Match |
| 90 | +``` |
| 91 | + |
| 92 | + |
| 93 | +#### `matchBind` |
| 94 | + |
| 95 | +``` purescript |
| 96 | +instance matchBind :: Bind Match |
| 97 | +``` |
| 98 | + |
| 99 | + |
| 100 | +#### `matchMonad` |
| 101 | + |
| 102 | +``` purescript |
| 103 | +instance matchMonad :: Monad Match |
| 104 | +``` |
| 105 | + |
| 106 | + |
| 107 | +#### `matchMonadPlus` |
| 108 | + |
| 109 | +``` purescript |
| 110 | +instance matchMonadPlus :: MonadPlus Match |
| 111 | +``` |
| 112 | + |
| 113 | + |
| 114 | +#### `runMatch` |
| 115 | + |
| 116 | +``` purescript |
| 117 | +runMatch :: forall a. Match a -> Route -> Either String a |
| 118 | +``` |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | +## Module Routing.Parser |
| 123 | + |
| 124 | +#### `parse` |
| 125 | + |
| 126 | +``` purescript |
| 127 | +parse :: String -> Route |
| 128 | +``` |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +## Module Routing.Setter |
| 133 | + |
| 134 | +#### `setHash` |
| 135 | + |
| 136 | +``` purescript |
| 137 | +setHash :: forall e. String -> Eff e Unit |
| 138 | +``` |
| 139 | + |
| 140 | + |
| 141 | +#### `RouteState` |
| 142 | + |
| 143 | +``` purescript |
| 144 | +class RouteState a where |
| 145 | + toHash :: a -> String |
| 146 | +``` |
| 147 | + |
| 148 | +Class of types that can be converted to hashes |
| 149 | + |
| 150 | +#### `setRouteState` |
| 151 | + |
| 152 | +``` purescript |
| 153 | +setRouteState :: forall r e. (RouteState r) => r -> Eff e Unit |
| 154 | +``` |
| 155 | + |
| 156 | +wrapper over `setHash` that uses `RouteState` |
| 157 | + |
| 158 | + |
| 159 | +## Module Routing.Types |
| 160 | + |
| 161 | +#### `RoutePart` |
| 162 | + |
| 163 | +``` purescript |
| 164 | +data RoutePart |
| 165 | + = Path String |
| 166 | + | Query (M.StrMap String) |
| 167 | +``` |
| 168 | + |
| 169 | + |
| 170 | +#### `Route` |
| 171 | + |
| 172 | +``` purescript |
| 173 | +type Route = [RoutePart] |
| 174 | +``` |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | +## Module Routing.Match.Class |
| 179 | + |
| 180 | +#### `MatchClass` |
| 181 | + |
| 182 | +``` purescript |
| 183 | +class (MonadPlus f) <= MatchClass f where |
| 184 | + lit :: String -> f Unit |
| 185 | + var :: f String |
| 186 | + param :: String -> f String |
| 187 | + fail :: forall a. String -> f a |
| 188 | +``` |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | +## Module Routing.Match.Combinators |
| 193 | + |
| 194 | +#### `num` |
| 195 | + |
| 196 | +``` purescript |
| 197 | +num :: forall f. (MatchClass f) => String -> f Number |
| 198 | +``` |
| 199 | + |
| 200 | + |
| 201 | +#### `bool` |
| 202 | + |
| 203 | +``` purescript |
| 204 | +bool :: forall f. (MatchClass f) => String -> f Boolean |
| 205 | +``` |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
0 commit comments