Clone this repo: https://github.com/bigardone/elm-css-patterns/blob/master/elm.json
- Setup
elm-review
rule for quick edit/feedback cycle
sentinel props = | |
Html.Styled.node "intersection-sentinel" | |
[ Attributes.class "h-8 block" | |
, Attributes.style "background-color" "red" | |
, Attributes.disabled props.disabled | |
, Attributes.attribute "disabled" | |
(if props.disabled then | |
"true" | |
else |
Clone this repo: https://github.com/bigardone/elm-css-patterns/blob/master/elm.json
elm-review
rule for quick edit/feedback cyclemodule ElmCssExtractor exposing (rule) | |
import Elm.Syntax.Expression as Expression exposing (Expression) | |
import Elm.Syntax.ModuleName exposing (ModuleName) | |
import Elm.Syntax.Node as Node exposing (Node(..)) | |
import Elm.Syntax.Range exposing (Range) | |
import Json.Encode | |
import Review.ModuleNameLookupTable as ModuleNameLookupTable exposing (ModuleNameLookupTable) | |
import Review.Rule as Rule exposing (Error, Rule) |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE DeriveAnyClass #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE LambdaCase #-} | |
module ColorParser where | |
import Control.Monad | |
import Data.Aeson as A (ToJSON, Value, encode, object, (.=)) | |
import Data.Aeson.Key (fromString) |
module Main where | |
import Prelude | |
import Data.Maybe (Maybe(..)) | |
import Data.Map as Map | |
import Data.Traversable as Traversable | |
import Effect (Effect) | |
import Effect.Exception as Exception | |
import Effect.Unsafe as Effect.Unsafe |
Often we want to iterate through a collection of items, performing some effect for each item. This means we want some function that looks like
(a -> f b) -> t a -> result
where a -> f b
is our effectful computation, t a
is our collection (of a
s) and result
could take a few different shapes depending on the requirements of our program, especially in the common case when the effect f
encapsulates some notion of failure (like TaskEither
in fp-ts
, or anything with ExceptT
in its stack in Haskell
).
[!TIP]
module FnReport exposing (rule) | |
{-| Run with | |
elm-review ./src/Well/I18n.elm --extract --report=json --rules FnReport | jq -r '.extracts.FnReport' | |
-} | |
import Dict | |
import Elm.Syntax.Declaration as Declaration exposing (Declaration) |
module ModuleUsage exposing (..) | |
import Dict exposing (Dict) | |
import Elm.Syntax.Expression as Expression exposing (Expression) | |
import Elm.Syntax.Import exposing (Import) | |
import Elm.Syntax.ModuleName exposing (ModuleName) | |
import Elm.Syntax.Node as Node exposing (Node) | |
import Json.Encode as Encode | |
import Review.ModuleNameLookupTable as ModuleNameLookupTable exposing (ModuleNameLookupTable) | |
import Review.Project.Dependency as Dependency exposing (Dependency) |
// This code is an adaptation of https://codepen.io/Pillowfication/pen/PNEJbY | |
// Markus Tran deserves all the credit!!! | |
const random = Math.random | |
const cos = Math.cos | |
const sin = Math.sin | |
const PI = Math.PI | |
const PI2 = PI * 2 | |
const spread = 40 | |
const sizeMin = 3 |
module ExtractImportGraph exposing (rule) | |
import Dict exposing (Dict) | |
import Elm.Syntax.Import exposing (Import) | |
import Elm.Syntax.ModuleName exposing (ModuleName) | |
import Elm.Syntax.Node as Node exposing (Node) | |
import Json.Encode as Encode | |
import Review.Project.Dependency as Dependency exposing (Dependency) | |
import Review.Rule as Rule exposing (Rule) | |
import Set exposing (Set) |