commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 4.24k | new_contents stringlengths 1 5.44k | subject stringlengths 14 778 | message stringlengths 15 9.92k | lang stringclasses 277
values | license stringclasses 13
values | repos stringlengths 5 127k |
|---|---|---|---|---|---|---|---|---|---|
48db80f8d66dc1990cbe621116878bc24921a1cc | frontend/ColorScheme.elm | frontend/ColorScheme.elm |
module ColorScheme where
accent0 = rgb 90 99 120
accent1 = rgb 96 181 204
accent2 = rgb 240 173 0
accent3 = rgb 234 21 122
accent4 = rgb 127 209 59
lightGrey = rgb 245 245 245
mediumGrey = rgb 216 221 225
| module ColorScheme where
import Color (rgb)
greyBlue = rgb 90 99 120
blue = rgb 96 181 204
yellow = rgb 240 173 0
pink = rgb 234 21 122
green = rgb 127 209 59
background = rgb 253 253 253
lightGrey = rgb 245 245 245
mediumGrey = rgb 216 221 225
| Change variable names to be more pleasant to use | Change variable names to be more pleasant to use
| Elm | bsd-3-clause | itsgreggreg/package.elm-lang.org,jvoigtlaender/package.elm-lang.org,Dedoig/package.elm-lang.org,mgold/package.elm-lang.org |
834f64026fbfa3c50a945a02b4b39ee463bab1c9 | simulator/Simulator/Output.elm | simulator/Simulator/Output.elm | module Simulator.Output where
import Json.Decode as Json exposing (..)
import String
import Simulator.Command exposing (CommandCode)
type alias Output =
{ problemId: Int
, seed: Int
, tag: String
, solution: List CommandCode
}
parse : String -> Maybe (List Output)
parse outputString =
Result.toMaybe (dec... | module Simulator.Output where
import Json.Decode as Json exposing (..)
import String
import Simulator.Command exposing (CommandCode)
type alias Output =
{ problemId: Int
, seed: Int
, tag: String
, solution: List CommandCode
}
parse : String -> Maybe (List Output)
parse outputString =
Result.toMaybe (dec... | Revert accidental change in sample data | Revert accidental change in sample data
| Elm | bsd-3-clause | mietek/icfp-contest-2015,blax/icfp-contest-2015 |
c7d86052650545bec907bb3211143768785fd7ba | elm-tutorial/Main.elm | elm-tutorial/Main.elm | module App exposing (..)
import Html exposing (Html, div, text, program)
type alias Model =
String
init : ( Model, Cmd Msg )
init =
( "Hello World", Cmd.none )
type Msg
= NoOp
view : Model -> Html Msg
view model =
div []
[ text model ]
update : Msg -> Model -> ( Model, Cmd Msg )
updat... | module App exposing (..)
import Html exposing (Html, button, div, program, text)
import Html.Events exposing (onClick)
-- MODEL
type alias Model =
Bool
init : ( Model, Cmd Msg )
init =
( False, Cmd.none )
-- MESSAGES
type Msg
= Expand
| Collapse
-- VIEW
view : Model -> Html Msg
view mod... | Implement expand & collapse strings | :+1: Implement expand & collapse strings
| Elm | mit | otofu-square/elm-sandbox,otofu-square/elm-sandbox |
78110f54310a03e215658f927c30bf63cb611455 | Chain.elm | Chain.elm | module Chain exposing (Model, init, update, subscriptions)
import Html exposing (Html)
import Piece
import AnimationFrame
import Time exposing (Time)
import Style
type alias Model =
List Piece.Model
init : ( Model, Cmd Msg )
init =
( [], Cmd.none )
subscriptions : Model -> Sub Msg
subscriptions model =
... | module Chain
exposing
( Model
, init
, update
, subscriptions
)
import Html exposing (Html)
import Piece
import AnimationFrame
import Time exposing (Time)
import Style
type alias Model =
List Piece.Model
init : ( Model, Cmd Msg )
init =
( [], Cmd.none )
subscri... | Reformat formatting of code statement | Reformat formatting of code statement
| Elm | mit | oc-elixir-elm/oc-elixir-elm.github.io,oc-elixir-elm/oc-elixir-elm.github.io,oc-elixir-elm/oc-elixir-elm.github.io,oc-elixir-elm/oc-elixir-elm.github.io |
d83c3b8f186f67a054cc0d601d25e70e2c03d93c | tests/test-files/good/AllSyntax/0.16/LineComments/Declarations.elm | tests/test-files/good/AllSyntax/0.16/LineComments/Declarations.elm | module AllSyntax.LineComments.Declarations (..) where
type
--A
DataType
--B
= --C
Ctor1
--D
| --E
Ctor2
--F
()
--G
| --H
Ctor3
--I
(List ())
--J
()
type
--K
DataTypeWithParams
--L
a
... | module AllSyntax.LineComments.Declarations (..) where
type
--A
DataType
--B
= --C
Ctor1
--D
| --E
Ctor2
--F
()
--G
| --H
Ctor3
--I
(List ())
--J
()
type
--K
DataTypeWithParams
--L
a
... | Add missing tests for multiline type annotation | Add missing tests for multiline type annotation
| Elm | bsd-3-clause | nukisman/elm-format-short,nukisman/elm-format-short,nukisman/elm-format-short,nukisman/elm-format-short,avh4/elm-format,avh4/elm-format,nukisman/elm-format-short,avh4/elm-format,avh4/elm-format |
2502986d09b16a9abf21f2a967099d58bbaae7e9 | src/Silences/Views.elm | src/Silences/Views.elm | module Silences.Views exposing (..)
-- External Imports
import Html exposing (..)
import Html.Attributes exposing (..)
-- Internal Imports
import Types exposing (Silence)
import Utils.Views exposing (..)
silenceView : Silence -> Html msg
silenceView silence =
let
dictMatchers =
List.map (... | module Silences.Views exposing (..)
-- External Imports
import Html exposing (..)
import Html.Attributes exposing (..)
-- Internal Imports
import Types exposing (Silence)
import Utils.Views exposing (..)
silenceView : Silence -> Html msg
silenceView silence =
let
dictMatchers =
List.map (... | Add edit button to silence view | Add edit button to silence view
| Elm | apache-2.0 | Kellel/alertmanager,prometheus/alertmanager,prometheus/alertmanager,GoogleCloudPlatform/alertmanager,Aloomaio/alertmanager,joehandzik/alertmanager,Kellel/alertmanager,Aloomaio/alertmanager,stuartnelson3/am-ui,tinytub/alertmanager,GoogleCloudPlatform/alertmanager,tyrken/alertmanager,prometheus/alertmanager,stuartnelson3... |
05d3ec750e601a8c533d97301c0f1d62514f86db | src/elm/Models.elm | src/elm/Models.elm | module Models exposing (Model, Flags, initModel, currentToken)
import Material
import Routing exposing (Route(..))
import FileUpload.Models exposing (Upload, initUpload)
import Terms.Models exposing (Terms, initTerms)
import Target.Models exposing (Target, initTarget)
import Resolver.Models exposing (Resolver, initRes... | module Models exposing (Model, Flags, initModel, currentToken)
import Material
import Routing exposing (Route(..))
import FileUpload.Models exposing (Upload, initUpload)
import Terms.Models exposing (Terms, initTerms)
import Target.Models exposing (Target, initTarget)
import Resolver.Models exposing (Resolver, initRes... | Remove token, which is handled in the routes | Remove token, which is handled in the routes
| Elm | mit | GlobalNamesArchitecture/gnlist-resolver-gui,GlobalNamesArchitecture/gnlist-resolver-gui,GlobalNamesArchitecture/gnlist-resolver-gui,GlobalNamesArchitecture/gnlist-resolver-gui |
3bd650e086a9b5b71a17a71eae85ee27adc25939 | gui/elm/Model.elm | gui/elm/Model.elm | module Model exposing (..)
type Status
= Starting
| UpToDate
| Offline
| UserActionRequired
| Buffering
| SquashPrepMerging
| Syncing Int
| Error String
type Platform
= Windows
| Linux
| Darwin
type alias RemoteWarning =
{ title : String
, details : String
,... | module Model exposing (..)
type Status
= Starting
| UpToDate
| Offline
| UserActionRequired
| Buffering
| SquashPrepMerging
| Syncing Int
| Error String
type Platform
= Windows
| Linux
| Darwin
type alias RemoteWarning =
{ title : String
, error : String
, d... | Add missing error field to UserActionRequiredError | gui: Add missing error field to UserActionRequiredError
| Elm | agpl-3.0 | cozy-labs/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop,nono/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop |
50a497763d916f4776636ff3a453fc66582b8a95 | public/Try.elm | public/Try.elm | import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Elements/Image.elm" target="_top">Images</a>
* <a href="/edit/examples/Elements/LinearGradient.elm... | import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Reactive/Position.elm" target="_top">Mouse</a>
* <a href="/edit/examples/Intermediate/Clock.elm" t... | Use @mgold's suggestion for better examples | Use @mgold's suggestion for better examples
| Elm | bsd-3-clause | randomer/elm-lang.org,ThomasWeiser/elm-lang.org,kevinrood/elm-lang.org,semaj/jameslarisch.com-elm,FranklinChen/elm-lang.org,yang-wei/elm-lang.org,coreyhaines/elm-lang.org,liubko/elm-lang.org,randomer/elm-lang.org,rtfeldman/elm-lang.org,jvoigtlaender/elm-lang.org,frankschmitt/elm-lang.org,avh4/elm-lang.org,jazmit/elm-la... |
a7fb5aa16b7aab3cd81b313766743ba9eedf0f32 | elm/App.elm | elm/App.elm | module App where
import Html exposing (Html)
-- MODEL
type alias Model = Int
init : Model
init =
42
-- UPDATE
type Action
= NoOp
update : Action -> Model -> Model
update action model =
case action of
NoOp ->
model
-- SIGNALS
main : Signal Html
main =
Signal.map view model
model : Signa... | module App where
import Html exposing (Html)
-- MODEL
type alias Artist =
{ id: Int
, name: String
}
type alias Model =
List Artist
init : Model
init =
[]
-- UPDATE
type Action
= NoOp
update : Action -> Model -> Model
update action model =
case action of
NoOp ->
model
-- SIGNALS
... | Change model to list of artists | Change model to list of artists
| Elm | mit | kangkyu/real-world-elm,truqu/real-world-elm |
4a1aa8f7fcb53aa7f5cfb039147a53262497023a | src/Random/Pcg/Interop.elm | src/Random/Pcg/Interop.elm | module Random.Pcg.Interop exposing (fission)
{-| Provides a function to create a PCG seed from a seed in the core library.
This is useful for library writers who need a splittable or most robust PRNG but
don't want to require client code to use the PCG implementation.
```elm
import Random
import Random.Pcg
import Ran... | module Random.Pcg.Interop exposing (fission)
{-| Provides a function to create a PCG seed from a seed in the core library.
This is useful for library writers who need a splittable or most robust PRNG but
don't want to require client code to use the PCG implementation.
```elm
import Random
import Random.Pcg
import Ran... | Remove unnecessary parens in type | Remove unnecessary parens in type
| Elm | bsd-3-clause | mgold/elm-random-pcg,mgold/elm-random-pcg,mgold/elm-random-pcg |
ad8fe289467e00376cc497160c890961bc54eb3d | elm-in-action/PhotoGroove.elm | elm-in-action/PhotoGroove.elm | module PhotoGroove exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
view model =
div [ class "content" ]
[ h1 [] [ text "Photo Groove" ]
, div [ id "thumbnails" ]
[ img [ src "http://elm-in-action.com/1.jpeg" ] []
, img [ src "http://elm-in-action.com/2.jpeg" ] []
... | module PhotoGroove exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
urlPrefix = "http://elm-in-action.com/"
viewThumbnail selectedUrl thumbnail =
img
[ src (urlPrefix ++ thumbnail.url)
, classList [ ( "selected", selectedUrl == thumbnail.url... | Add user interaction, end of Chapter 2. | Add user interaction, end of Chapter 2.
| Elm | mit | pietro909/learning-elm |
7a9d9172e213597347f4f6f6ac36dd57197ff109 | exercises/armstrong-numbers/tests/Tests.elm | exercises/armstrong-numbers/tests/Tests.elm | module Tests exposing (tests)
import ArmstrongNumbers exposing (check)
import Expect
import String
import Test exposing (..)
tests : Test
tests =
describe "{exercise}"
[ test "Single digit numbers are Armstrong numbers" <|
\() ->
Expect.equal True
(Armstron... | module Tests exposing (tests)
import ArmstrongNumbers exposing (check)
import Expect
import String
import Test exposing (..)
tests : Test
tests =
describe "{exercise}"
[ test "Zero is an Armstrong number" <|
\() ->
Expect.equal True
(ArmstrongNumbers.check ... | Add missing test for 0 | Add missing test for 0
| Elm | mit | exercism/xelm |
5d5226eb2cfe31ea4a2986ebbd1afe39278e0299 | elm-in-action/PhotoGroove.elm | elm-in-action/PhotoGroove.elm | module PhotoGroove exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
urlPrefix = "http://elm-in-action.com/"
viewThumbnail selectedUrl thumbnail =
img
[ src (urlPrefix ++ thumbnail.url)
, classList [ ( "selected", selectedUrl == thumbnail.url... | module PhotoGroove exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Array exposing (Array)
type alias Photo =
{ url : String }
type alias Model =
{ photos : List Photo
, selectedUrl : String
}
type alias Msg =
{ operation : String
... | Add type annotations and refactor | Add type annotations and refactor
| Elm | mit | pietro909/learning-elm |
8d6ea480e0e012b8ca801713008181726d686ac1 | app/ui/src/Main.elm | app/ui/src/Main.elm | module Main exposing (..)
import Html
import Server as API
import Model exposing (Model, Output(..))
import Message exposing (Message(..))
import Components as UI
main =
Html.program
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
}
init : (... | module Main exposing (..)
import Html
import Server as API
import Model exposing (Model, Output(..))
import Message exposing (Message(..))
import Components as UI
main =
Html.program
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
}
init : (... | Use the literal syntax rather than a type constructor | Use the literal syntax rather than a type constructor
| Elm | mit | httpmark/httpmark,httpmark/httpmark,httpmark/httpmark |
84f0ebdd3913085780e1ecd2fdbf06f35a7f50b9 | app/src/Views/Retro/Contents.elm | app/src/Views/Retro/Contents.elm | module Views.Retro.Contents exposing (view)
import Bulma
import Data.Content exposing (Content)
import Html exposing (Html)
import Html.Attributes as Attr
view : List Content -> Html msg
view contents =
contents
|> List.map contentView
|> List.intersperse (Html.hr [] [])
|> Bulma.content ... | module Views.Retro.Contents exposing (view)
import Bitwise
import Bulma
import Char
import Data.Content exposing (Content)
import Html exposing (Html)
import Html.Attributes as Attr
view : List Content -> Html msg
view contents =
contents
|> List.map contentView
|> List.intersperse (Html.hr [] []... | Use hash of card's author, this probably isn't the best | Use hash of card's author, this probably isn't the best
| Elm | mit | hawx/retro,hawx/retro,hawx/retro |
389bd89e1db44080c217eeaf3400d12a52ca4c40 | src/static/js/Helpers.elm | src/static/js/Helpers.elm | module Helpers exposing (..)
import Array exposing (Array, fromList, toList)
import List
import List.Extra exposing (splitAt, takeWhile)
import Maybe.Extra exposing (isJust, maybeToList)
import String exposing (split, join)
takeJusts : Array (Maybe a) -> List a
takeJusts arr =
let justs =
Array.filte... | module Helpers exposing (..)
import Array exposing (Array, fromList, toList)
import List
import List.Extra exposing (splitAt, takeWhile)
import Maybe.Extra exposing (isJust, maybeToList)
import String exposing (split, join)
type alias Position =
{ x : Int
, y : Int
, w : Int
, h : Int
}
takeJus... | Add a Position helper type | Add a Position helper type
| Elm | bsd-3-clause | valrus/undertale-dialog-generator,valrus/undertale-dialog-generator,valrus/undertale-dialog-generator |
8005ceaa3a8ce1a6ae3439548624c23332741002 | ElmTest/Runner/Console.elm | ElmTest/Runner/Console.elm | module ElmTest.Runner.Console (runDisplay) where
{-| Run a test suite as a command-line script.
# Run
@docs runDisplay
-}
import IO.IO (..)
import ElmTest.Test (..)
import ElmTest.Runner.String as RString
{-| Run a list of tests in the IO type from [Max New's Elm IO library](https://github.com/maxsnew/IO/).
Requi... | module ElmTest.Runner.Console (runDisplay) where
{-| Run a test suite as a command-line script.
# Run
@docs runDisplay
-}
import List
import IO.IO (..)
import ElmTest.Test (..)
import ElmTest.Run as Run
import ElmTest.Runner.String as String
{-| Run a list of tests in the IO type from [Max New's Elm IO library](... | Switch console runner to new String.run function | Switch console runner to new String.run function
| Elm | bsd-3-clause | robertjlooby/elm-test,elm-community/elm-test |
d8b6f08cbc7434e4e922fac555661d72599e2da5 | src/Styles/Constants.elm | src/Styles/Constants.elm | module Styles.Constants exposing (..)
-- Dimensions
standardBorderRadius : Float
standardBorderRadius =
6
-- Colors
black : String
black =
"0F2037"
grey : String
grey =
"CFD0CE"
white : String
white =
"FCFEFB"
lightGrey : String
lightGrey =
"EBECEA"
darkGrey : String
darkGrey =
"... | module Styles.Constants exposing (..)
-- Dimensions
standardBorderRadius : Float
standardBorderRadius =
6
-- Colors (developed under https://coolors.co/e52938-fcfefb-3fafb5-2d739e-173156)
black : String
black =
"0F2037"
grey : String
grey =
"CFD0CE"
white : String
white =
"FCFEFB"
lightGre... | Add coolors.co link with color palette | Add coolors.co link with color palette
| Elm | mit | peterszerzo/elm-gameroom,peterszerzo/elm-gameroom,peterszerzo/elm-gameroom |
56abfd73c50a69928cb32bdc59d13f73d69ed823 | src/Parsing.elm | src/Parsing.elm | module Parsing exposing (..)
-- External Imports
import Navigation
import UrlParser exposing (Parser, (</>), map, int, oneOf, s, string)
import String
-- Internal Imports
import Types exposing (Route(..))
-- Parsing
urlParser : Navigation.Location -> Route
urlParser location =
case UrlParser.parseHash rout... | module Parsing exposing (..)
-- External Imports
import Navigation
import UrlParser exposing (Parser, (</>), map, int, oneOf, s, string, parseHash)
import String
-- Internal Imports
import Types exposing (Route(..))
-- Parsing
urlParser : Navigation.Location -> Route
urlParser location =
case parseHash rou... | Use exposed imports in parsing | Use exposed imports in parsing
| Elm | apache-2.0 | stuartnelson3/am-ui,Aloomaio/alertmanager,Aloomaio/alertmanager,prometheus/alertmanager,tyrken/alertmanager,joehandzik/alertmanager,tyrken/alertmanager,Kellel/alertmanager,stuartnelson3/am-ui,Aloomaio/alertmanager,joehandzik/alertmanager,joehandzik/alertmanager,GoogleCloudPlatform/alertmanager,Kellel/alertmanager,tinyt... |
c7d2a8f5e4a95ddd39043c6951ff6bc49f81d4f1 | Docker.elm | Docker.elm | module Docker exposing (..)
import Dict exposing (Dict)
import Docker.Types exposing (..)
import Docker.Json exposing (parse)
indexTasks : List Task -> TaskIndex
indexTasks tasks =
let
reducer task result =
let
key =
( task.nodeId, task.serviceId )
... | module Docker exposing (..)
import Dict exposing (Dict)
import Docker.Types exposing (..)
import Docker.Json exposing (parse)
indexTasks : List Task -> TaskIndex
indexTasks tasks =
let
reducer task result =
let
key =
( task.nodeId, task.serviceId )
... | Sort nodes and services alphabetically | Sort nodes and services alphabetically
| Elm | mit | charypar/swarm-dashboard,charypar/swarm-dashboard,charypar/swarm-dashboard |
1240c5d633d5ac26dd52c7535383375cf1b3f880 | src/Views/Tutorial/Styles.elm | src/Views/Tutorial/Styles.elm | module Views.Tutorial.Styles exposing (..)
import Html
import Html.CssHelpers
import Css exposing (..)
import Css.Namespace exposing (namespace)
import Styles.Constants exposing (..)
import Styles.Mixins as Mixins
cssNamespace : String
cssNamespace =
"tutorial"
type CssClasses
= Root
| Button
localCl... | module Views.Tutorial.Styles exposing (..)
import Html
import Html.CssHelpers
import Css exposing (..)
import Css.Namespace exposing (namespace)
import Styles.Constants exposing (..)
import Styles.Mixins as Mixins
cssNamespace : String
cssNamespace =
"tutorial"
type CssClasses
= Root
| Button
localCl... | Fix tutorial centering bug on safari | Fix tutorial centering bug on safari
| Elm | mit | peterszerzo/elm-gameroom,peterszerzo/elm-gameroom,peterszerzo/elm-gameroom |
7de7486b6aa2ef809ce088558913b687b532ac40 | client/src/app.elm | client/src/app.elm | module App exposing (..)
import String exposing (isEmpty)
import Html exposing (..)
import Html.Events exposing (onSubmit, onInput)
import Html.Attributes exposing (id, class, type_, placeholder, value)
main =
Html.beginnerProgram {
model = model,
view = view,
update = update
}
-- Model
type alias M... | module App exposing (..)
import String exposing (isEmpty)
import Html exposing (..)
import Html.Events exposing (onSubmit, onInput)
import Html.Attributes exposing (id, class, type_, placeholder, value)
main =
Html.beginnerProgram {
model = model,
view = view,
update = update
}
-- Model
type alias M... | Rename type: Msg -> Action | Rename type: Msg -> Action
채팅프로그램이다보니, 메세지라는 말을 쓰면 헷갈림
| Elm | agpl-3.0 | openirc/openirc,openirc/openirc,openirc/openirc,openirc/openirc |
01ddd5c7caddeb48acf9b372e831452165f564ef | src/Responsive.elm | src/Responsive.elm | module Responsive exposing (Palette, defaultPalette, palette)
import Element exposing (Device)
import Element.Attributes exposing (px)
import Styles exposing (responsiveForWidth)
palette : Device -> Palette
palette device =
{ navbarButtonHeight = ( 20, 80 ) |> responsiveForWidth device |> px
}
defaultPalet... | module Responsive exposing (Palette, defaultPalette, palette)
import Element exposing (Device)
import Element.Attributes exposing (px)
palette : Device -> Palette
palette device =
{ navbarButtonHeight = ( 20, 80 ) |> responsiveForWidth device |> px
}
defaultPalette : Palette
defaultPalette =
{ navbarBu... | Duplicate responsiveForWidth into responsive so it can be removed from Styles later. | Duplicate responsiveForWidth into responsive so it can be removed from Styles later.
| Elm | mit | dillonkearns/mobster,dillonkearns/mobster,dillonkearns/mobster,dillonkearns/mobster |
d1fcfb1c50d683d7adc6be62c07b47eac302a2ec | src/Network.elm | src/Network.elm | module Network exposing (send, connect, parseServerMessage, PlayerMessage(..), ServerMessage(..))
import Json.Decode as Decode
import Json.Encode as Encode
import Keyboard exposing (KeyCode)
import Result
import WebSocket
send : PlayerMessage -> Cmd msg
send =
WebSocket.send "ws://127.0.0.1:9160" << encodePlayer... | module Network exposing (send, connect, parseServerMessage, PlayerMessage(..), ServerMessage(..))
import Json.Decode as Decode
import Json.Encode as Encode
import Keyboard exposing (KeyCode)
import Result
import WebSocket
send : PlayerMessage -> Cmd msg
send =
WebSocket.send "ws://127.0.0.1:9160" << encodePlayer... | Fix bug where the Connected constructor still took a string as an argument | Fix bug where the Connected constructor still took a string as an argument
| Elm | mit | schroffl/elm-webgl-game,schroffl/elm-webgl-game |
f2d0b6cbdeba2b232666101be94a8da908d022c5 | public/examples/Intermediate/Clock.elm | public/examples/Intermediate/Clock.elm |
main = lift clock (every second)
clock t =
let blu = hsv (degrees 200) 0.6 1
in collage 400 400 [ filled blu (ngon 12 110)
, hand (complement blu) 100 t
, hand black 100 (t/60)
, hand black 60 (t/720) ]
hand clr len time =
let angle ... |
main = lift clock (every second)
clock t = collage 400 400
[ filled (rgb 98 177 208) (ngon 12 110),
hand red 100 t,
hand black 100 (t/60),
hand black 60 (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <|... | Make the clock example simpler. | Make the clock example simpler.
| Elm | bsd-3-clause | coreyhaines/elm-lang.org,akeeton/elm-lang.org,liubko/elm-lang.org,thSoft/elm-lang.org,avh4/elm-lang.org,inchingforward/elm-lang.org,elm-lang/debug.elm-lang.org,ThomasWeiser/elm-lang.org,liubko/elm-lang.org,coreyhaines/elm-lang.org,randomer/elm-lang.org,frankschmitt/elm-lang.org,akeeton/elm-lang.org,eeue56/elm-lang.org,... |
dd91f7e83dfc43e44e6591ee3cc7fe8b5da662ea | src/TypeVariables.elm | src/TypeVariables.elm | import Html exposing (..)
import Html.Attributes exposing (..)
numbers =
[ 1, 2, 3, 4, 5 ]
fruits =
[ { name = "Orange" }, { name = "Banana" } ]
printNumbers : Int -> Html msg
printNumbers int =
li [] [ text <| toString int ]
main =
ul [] (List.map printNumbers numbers)
| import Html exposing (..)
import Html.Attributes exposing (..)
numbers =
[ 1, 2, 3, 4, 5 ]
fruits =
[ { name = "Orange" }, { name = "Banana" } ]
printThing : thing -> Html msg
printThing thing =
li [] [ text <| toString thing ]
main =
div []
[ ul [] (List.map printThing numbers)
, u... | Make print function type agnostic | Make print function type agnostic
| Elm | mit | mtheoryx/elm-hello-world,mtheoryx/elm-hello-world |
62bd665863ce03989aa9503a99156e18aa6bf2dc | src/Partials/Blog.elm | src/Partials/Blog.elm | module Partials.Blog exposing(..)
import Partials.Messages exposing (Msg)
import Html exposing (Html, div, a, p, text, h2)
import Html.Attributes exposing (classList, href)
blogContent : Html Msg
blogContent =
div [ classList [ ( "links-container", True ) ] ]
[ p [] [ a [ classList [ ( "blog", True... | module Partials.Blog exposing(..)
import Partials.Messages exposing (Msg)
import Html exposing (Html, div, a, p, text, h2)
import Html.Attributes exposing (classList, href)
blogContent : Html Msg
blogContent =
div [ classList [ ( "links-container", True ) ] ]
[ p [] [ a [ classList [ ( "blog", True... | Add second blog post link | Add second blog post link
| Elm | mit | rchatrath7/rakeshchatrath,rchatrath7/rakeshchatrath,rchatrath7/rakeshchatrath |
a922de1b2b30cd0c316cc7a33d60a7444329fcac | app/Data/Wallet.elm | app/Data/Wallet.elm | module Data.Wallet exposing (Wallet, wallet)
type alias Wallet =
{ address : String
, balance : Maybe Float
, error : Maybe String
, expandError : Bool
, fetchingBalance : Bool
}
wallet : String -> Bool -> Wallet
wallet address fetchingBalance =
{ address = address
, balance = Nothin... | module Data.Wallet exposing (..)
type alias Wallet =
{ address : String
, balance : Maybe Float
, error : Maybe String
, expandError : Bool
, fetchingBalance : Bool
}
wallet : String -> Bool -> Wallet
wallet address fetchingBalance =
{ address = address
, balance = Nothing
, erro... | Make wallet module expose everything since no private stuff | Make wallet module expose everything since no private stuff
| Elm | mit | nilchaos87/cache,nilchaos87/cache |
e61acf3fbbc6637ec49084520c543ed22eecbbce | src/Main.elm | src/Main.elm | import Time exposing (Time,second)
import Html exposing (Html,text)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bound)
import Dirty
import Random
-- Model
type alias Model =
{ alive : Set Coordinate
, width : Int
, height : Int }
init : (Model, Cmd Msg)
init =
let
width = 10
... | import Time exposing (Time,second)
import Html exposing (Html,text)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bounds)
import Dirty
import Random
-- Model
type alias Model =
{ alive : Set Coordinate
, bounds : Bounds
}
init : (Model, Cmd Msg)
init =
let
bounds = { x = 0, y = ... | Update main Model to handle Bounds type | Update main Model to handle Bounds type
| Elm | mit | nafarlee/elm-game-of-life |
76d007816efe5109af927c6a185147172f4ba54d | app/javascript/Main.elm | app/javascript/Main.elm | module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
-- MODEL
type alias Show =
{ id : Int
, name : String
, overview : String
, show_poster : String
}
type alias Model =
{ shows : List Show
}
-- FLAGS
type alias Flags =
List Show
-- INI... | module Main exposing (..)
import Html exposing (text)
main : Html.Html msg
main =
text "Hello, from Elm!"
| Remove previously used Elm code | Remove previously used Elm code
| Elm | mit | kevgathuku/trackflix,kevgathuku/trackflix |
2d2ebc07ccb51896b44142ed79bee94d0aaeddd1 | ViewPhotos.elm | ViewPhotos.elm | module ViewPhotos exposing (viewPhotos)
import Html exposing (..)
import Html.Attributes exposing (class, style, title, src, id)
import Types exposing (..)
import DateUtils exposing (..)
import Dict
--------------------------------------------------------------------------------
-- View functions
--------------------... | module ViewPhotos exposing (viewPhotos)
import Html exposing (..)
import Html.Attributes exposing (class, style, title, src, id, value)
import Types exposing (..)
import DateUtils exposing (..)
import Time.Date as Date exposing (Weekday(..))
import Html.Events exposing (onClick)
import Dict
--------------------------... | Add buttons for previous or next days | Add buttons for previous or next days
| Elm | mit | maxf/waterfall,maxf/waterfall,maxf/waterfall,maxf/waterfall |
eb590cb460c2b9c2664f988b4b73e072b184ca2c | src/Setup/Settings.elm | src/Setup/Settings.elm | module Setup.Settings exposing (..)
import Basics.Extra exposing ((=>))
import Json.Decode as Decode
import Json.Decode.Pipeline exposing (..)
import Json.Encode as Encode
import Roster.Data exposing (RosterData)
type alias Data =
{ timerDuration : Int
, breakDuration : Int
, intervalsPerBreak : Int
... | module Setup.Settings exposing (..)
import Basics.Extra exposing ((=>))
import Json.Decode as Decode
import Json.Decode.Pipeline exposing (..)
import Json.Encode as Encode
import Roster.Data exposing (RosterData)
type alias Data =
{ timerDuration : Int
, breakDuration : Int
, intervalsPerBreak : Int
... | Make Ctrl/Cmd+shift+L the default show/hide shortcut. | Make Ctrl/Cmd+shift+L the default show/hide shortcut.
| Elm | mit | dillonkearns/mobster,dillonkearns/mobster,dillonkearns/mobster,dillonkearns/mobster |
584e8704f4d6d468c670a0953edf7cbeca61ff34 | src/elm/Marshalling.elm | src/elm/Marshalling.elm | module Marshalling (scorecardToJson) where
{-|
@docs scorecardToJson
-}
import Bowling exposing (..)
import Json.Encode exposing (..)
gutterValue = string "-"
spareValue = string "/"
strikeValue = string "X"
pinValue : Int -> Value
pinValue p =
case p of
0 -> gutterValue
otherwise -> string <| toStri... | module Marshalling (scorecardToJson) where
{-|
@docs scorecardToJson
-}
import Bowling exposing (..)
import Json.Encode exposing (..)
gutterValue = string "-"
spareValue = string "/"
strikeValue = string "X"
pinValue : Int -> Value
pinValue p =
case p of
0 -> gutterValue
otherwise -> string <| toStri... | Add the players' scores to the JSON | Add the players' scores to the JSON
| Elm | bsd-3-clause | anicholson/elm-bowling,anicholson/elm-bowling,anicholson/elm-bowling |
7213488136bf4de6d25be2e7f17ccf7083cee16d | IdeaFight/ForestTest.elm | IdeaFight/ForestTest.elm | import Html.App as App
import Html exposing (Html, br, div, text)
import IdeaFight.PartialForest as Forest
import IdeaFight.Shuffle as Shuffle
import Random
import Time
type alias Model = Forest.Forest Int
type Msg = ShuffleMe (List Int) | Advance
stepForest : Forest.Forest comparable -> Forest.Forest comparable
st... | import Html.App as App
import Html exposing (Html, br, button, div, text)
import Html.Events exposing (onClick)
import IdeaFight.PartialForest as Forest
import IdeaFight.Shuffle as Shuffle
import Random
import Time
type alias Model = Forest.Forest Int
type Msg = ShuffleMe (List Int) | Advance
stepForest : Forest.Fo... | Advance forest test with clicks | Advance forest test with clicks
| Elm | mit | hoelzro/idea-fight |
4f380c91058b532e510695f4932a8a065b15895b | randomuser/elm/Main.elm | randomuser/elm/Main.elm | module Main where
import Graphics.Element exposing (show)
main: Graphics.Element.Element
main =
show "Ready"
| module Main where
import Http
import Json.Decode as Json exposing ((:=))
import Task exposing (Task)
import Graphics.Element exposing (show, Element)
import Signal
type alias User =
{ email: String
}
type Action = NoOp
| UpdateEmail String
mailbox: Signal.Mailbox Action
mailbox = Signal.mailbox NoOp... | Prepare Basic structure for holding random user data and displaying it. | RandomUser: Prepare Basic structure for holding random user data and displaying it.
| Elm | isc | maciejsmolinski/elm-playground,maciejsmolinski/elm-playground |
9e10df303c8fe5e726b69e8d31d8657cd54ad9f6 | src/Resources.elm | src/Resources.elm | module Resources exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
type alias Resource =
{ url : String, dsc : String }
resources : List Resource
resources =
[ { url = "https://google.com"
, dsc = "Awesome site, really great."
}
, { url = "https://stackoverflow.co... | module Resources exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
type alias Resource =
{ url : String, dsc : String }
resources : List Resource
resources =
[ { url = "https://dennisreimann.de/articles/elm-data-structures-record-tuple.html"
, dsc = "Elm Data Structures (2)... | Add some actual elm links | Add some actual elm links
| Elm | mit | newswim/learnelm,newswim/learnelm |
0bc9967fa5cb4da6f27baaac254901ccff5a5fb4 | src/Dirty.elm | src/Dirty.elm | module Dirty exposing (find)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bound)
find : Set (Coordinate) -> Bound -> Set (Coordinate)
find alive bounds =
reducer : Coordinate -> Set(Coordinate) -> Set(Coordinate)
reducer current accumulated =
let
(x, y) = current
new = Set.fromLis... | module Dirty exposing (find)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bounds)
find : Set (Coordinate) -> Bounds -> Set (Coordinate)
find alive bounds =
reducer : Coordinate -> Set(Coordinate) -> Set(Coordinate)
reducer current accumulated =
let
(x, y) = current
new = Set.fromL... | Update import statements based on Cardinal API change | Update import statements based on Cardinal API change
| Elm | mit | nafarlee/elm-game-of-life |
70acdd3a2c51429877b09f874bc8e89752751370 | elm/sublist/Sublist.elm | elm/sublist/Sublist.elm | module Sublist exposing (..)
type ListComparison = Equal | Unequal | Sublist | Superlist
sublist: List Int -> List Int -> ListComparison
sublist list1 list2 =
if list1 == list2 then
Equal
else if isSublist list1 list2 then
Sublist
else if isSublist list2 list1 then
Superlist
e... | module Sublist exposing (..)
type ListComparison = Equal | Unequal | Sublist | Superlist
sublist: List Int -> List Int -> ListComparison
sublist list1 list2 =
if list1 == list2 then
Equal
else if isSublist list1 list2 then
Sublist
else if isSublist list2 list1 then
Superlist
e... | Stop recursion if list2 is shorter than list1 | Stop recursion if list2 is shorter than list1
| Elm | mit | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism |
dbeaf54bcf9800bea5a441ba5f4c8f1788b2f00a | src/OpenSolid/Svg.elm | src/OpenSolid/Svg.elm | module OpenSolid.Svg
( svg
, lineSegment
) where
import Svg exposing (Svg, Attribute)
import Svg.Attributes as Attributes
import OpenSolid.Interval as Interval exposing (Interval)
import OpenSolid.Box2d as Box2d exposing (Box2d)
import OpenSolid.LineSegment2d as LineSegment2d exposing (LineSegment2d)
svg: Flo... | module OpenSolid.Svg
( svg
, lineSegment
) where
import Svg exposing (Svg, Attribute)
import Svg.Attributes as Attributes
import String
import OpenSolid.Interval as Interval exposing (Interval)
import OpenSolid.Box2d as Box2d exposing (Box2d)
import OpenSolid.LineSegment2d as LineSegment2d exposing (LineSegment... | Make SVG code a little more readable | Make SVG code a little more readable
| Elm | mpl-2.0 | opensolid/geometry |
6d39045cfac00d831f6be37a66e54d90abeb9005 | src/Update.elm | src/Update.elm | module Update exposing (..)
import Messages exposing (Msg(..))
import Models exposing (..)
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
NoOp ->
( model, Cmd.none )
OnFetchDebts ( Ok newDebts ) ->
( { model | debts = newDebts }, Cmd.none )
OnFetchDebts ( Err erro... | module Update exposing (..)
import List.Extra exposing (unique)
import Messages exposing (Msg(..))
import Models exposing (..)
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
NoOp ->
( model, Cmd.none )
OnFetchDebts ( Ok newDebts ) ->
( onFetchDebts model newDebts, Cmd... | Add participants to form on receive transactions | Add participants to form on receive transactions
| Elm | mit | gish/skulder-elm-client,gish/skulder-elm-client |
99d4d2cba340b6b3dd2e6a382d8836ac5ed7982a | Main.elm | Main.elm | module Main exposing (main)
import Html exposing (..)
import Html.Events exposing (onClick)
main =
Html.beginnerProgram
{ model = initialModel
, view = view
, update = update
}
type State
= Open
| Closed
type alias Model =
{ state : State, values : List String }
... | module Main exposing (main)
import Html exposing (..)
import Html.Events exposing (onClick)
main =
Html.beginnerProgram
{ model = initialModel
, view = view
, update = update
}
type State
= Open
| Closed
type alias Model =
{ state : State
, values : List String... | Add the concept of a "selected" value | Add the concept of a "selected" value
The whole point of this is to be able to select values. Since it's
possible for no values to be selected, we wrap it in `Maybe`.
The view gets trickier because there are now 4 ways to render the
dropdown:
Open vs Closed each with the appropriate click handler and displaying
the ... | Elm | bsd-3-clause | JoelQ/example-elm-searchable-dropdown |
6d821391442a70ee3e50f58b5f86de3316ae56c5 | Main.elm | Main.elm | module Main (..) where
import Box
import BoxList
import Effects exposing (Effects, Never)
import Html exposing (div, Html, text)
import Html.Attributes exposing (style)
import StartApp exposing (start)
import Task
type alias Model =
{ boxLists : List BoxList.Model
}
type Action
= None
update : Action -> Mo... | module Main (..) where
import Box
import BoxList
import Effects exposing (Effects, Never)
import Html exposing (button, div, Html, text)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import StartApp exposing (start)
import Task
type alias ID =
Int
type alias Model =
{ boxLists :... | Add button to add new box lists | Add button to add new box lists
| Elm | mit | robertjlooby/elm-html5-drag-and-drop |
9edcbeb0268b27eb3ad2649a3d9cfe402920bbac | frontend/Component/View.elm | frontend/Component/View.elm | module Component.View exposing (view)
import Component.Model exposing (..)
import Component.Messages exposing (..)
import Html exposing (Html, div, text, a)
import Html.Attributes exposing (class, href)
import Nav.Nav exposing (toHash)
import Nav.Model exposing (Page(..))
componentClass : Status -> String
componentC... | module Component.View exposing (view)
import Component.Model exposing (..)
import Component.Messages exposing (..)
import Html exposing (Html, div, text, a)
import Html.Attributes exposing (class, href)
import Nav.Nav exposing (toHash)
import Nav.Model exposing (Page(..))
statusIcon : Status -> String
statusIcon sta... | Prepend component with status icon | Prepend component with status icon
| Elm | apache-2.0 | Espenhh/panopticon,Espenhh/panopticon,Espenhh/panopticon,Espenhh/panopticon |
81d5f6f58e9aa29bdc7eb368426e957411e57975 | IdeaFight/LandingPage.elm | IdeaFight/LandingPage.elm | module IdeaFight.LandingPage exposing (Model, Msg, init, update, subscriptions, view)
import Html.App as App
import Html exposing (Html, br, button, div, h1, hr, text, textarea)
import Html.Events exposing (onClick, onInput)
type alias Model = (String, Bool)
type Msg = UpdateContents String | Continue
init : (Model,... | -- XXX you need at least three ideas (or whatever N is)
module IdeaFight.LandingPage exposing (Model, Msg, init, update, subscriptions, view)
import Html.App as App
import Html exposing (Html, br, button, div, h1, hr, text, textarea)
import Html.Events exposing (onClick, onInput)
type alias Model = (String, Bool)
typ... | Make note of validation that's needed | Make note of validation that's needed
| Elm | mit | hoelzro/idea-fight |
dec3570df533529b2a751040843b1e6340635a10 | src/elm/GoogleMapMarker.elm | src/elm/GoogleMapMarker.elm | module GoogleMapMarker
exposing
( Model
, fromOffice
)
import Office.Model as Office
type alias Model =
{ latLng : { lat : Float, lng : Float }
, id : Int
}
fromOffice : Office.Model -> Model
fromOffice ({ id } as office) =
let
(Office.Id officeId) =
... | module GoogleMapMarker
exposing
( Model
, fromOffice
)
import Json.Encode as Encode
import Office.Model as Office
import Address.Model as Address
type alias Model =
Encode.Value
fromOffice : Office.Model -> Model
fromOffice ({ id } as office) =
Encode.object
[ ( "id", en... | Switch from primitive handling to Json.Encode | Switch from primitive handling to Json.Encode
| Elm | mit | joshuaclayton/elm-ports-example,joshuaclayton/elm-ports-example |
1e9caf84781cfe58e8a92abfdf6ca5dfe67ebc93 | frontend/public/examples/Reactive/KeysDown.elm | frontend/public/examples/Reactive/KeysDown.elm |
-- Focus on the display screen (i.e. click the right half of this window)
-- and start pressing keys!
import Graphics.Element exposing (..)
import Keyboard
display : List Int -> Element
display keyCodes =
show "You are holding down the following keys: " `beside` show keyCodes
main : Signal.Signal Element
main =... |
-- Focus on the display screen (i.e. click the right half of this window)
-- and start pressing keys!
import Graphics.Element exposing (..)
import Keyboard
import Set
display : Set.Set Int -> Element
display keyCodes =
flow right
[ show "You are holding down the following keys: "
, show (Set.toList keyCod... | Adjust for new type of Keyboard.keysDown | Adjust for new type of Keyboard.keysDown
| Elm | bsd-3-clause | coreyhaines/elm-lang.org,randomer/elm-lang.org,yang-wei/elm-lang.org,amitaibu/elm-lang.org,jazmit/elm-lang.org,jvoigtlaender/elm-lang.org,randomer/elm-lang.org,yang-wei/elm-lang.org,liubko/elm-lang.org,kevinrood/elm-lang.org,inchingforward/elm-lang.org,coreyhaines/elm-lang.org,akeeton/elm-lang.org,frankschmitt/elm-lang... |
c70beaea717d7d5e9a8d7a1654bc20b1866b1dc2 | src/views/TransactionTable.elm | src/views/TransactionTable.elm | module Views.TransactionTable exposing (transactionTable)
import Date exposing (..)
import Date.Format exposing (format)
import Html exposing (..)
import Html.Attributes exposing (class)
import Models exposing (Model, Debt)
import Messages exposing (Msg(..))
transactionTable : List Debt -> Html Msg
transactionTable d... | module Views.TransactionTable exposing (transactionTable)
import Date exposing (..)
import Date.Format exposing (format)
import Html exposing (..)
import Html.Attributes exposing (class)
import Models exposing (Model, Debt)
import Messages exposing (Msg(..))
transactionTable : List Debt -> Html Msg
transactionTable d... | Sort transactions by date desc | Sort transactions by date desc
| Elm | mit | gish/skulder-elm-client,gish/skulder-elm-client |
9a526287ee7051cf08b235731e86705b09830e39 | src/Display.elm | src/Display.elm | module Display (..) where
import Html exposing (..)
import Html.Attributes exposing (..)
import Mouse
cell : Attribute
cell =
style
[("margin", "10px")
, ("width", "30%")
, ("height", "200px")
, ("text-align", "center")
, ("-webkit-user-select", "none")
, ("user-select", "none")
, ("font... | module Display (..) where
import Html exposing (..)
import Html.Attributes exposing (..)
import Mouse
cell : Attribute
cell =
style
[("margin", "10px")
, ("width", "30%")
, ("height", "200px")
, ("text-align", "center")
, ("-webkit-user-select", "none")
, ("user-select", "none")
, ("font... | Add grid to display page | Add grid to display page
| Elm | mit | Bjornkjohnson/elm-TTT |
5a44a2a474a136a674ec41f5a1b7b6aaab641566 | web/src/Toolbox/Views.elm | web/src/Toolbox/Views.elm | module Toolbox.Views (..) where
import Html exposing (..)
import Html.Attributes exposing (..)
import Toolbox.Action exposing (Action)
import Toolbox.Types exposing (Ingredient, Model)
view : Signal.Address Action -> Model -> Html
view address model =
case model.response of
Just r ->
ul
[ class "... | module Toolbox.Views (..) where
import Html exposing (..)
import Html.Attributes exposing (..)
import Toolbox.Action exposing (Action)
import Toolbox.Types exposing (Ingredient, Model)
view : Signal.Address Action -> Model -> Html
view address model =
case model.response of
Just r ->
ul
[ class "... | Improve waiting message on initial load. | Improve waiting message on initial load.
| Elm | mit | zsiciarz/skyrim-alchemy-toolbox,zsiciarz/skyrim-alchemy-toolbox,zsiciarz/skyrim-alchemy-toolbox |
c808b695331fed39bb4e000f1c2170d2df484e34 | elm/IVFinal/App/Layout.elm | elm/IVFinal/App/Layout.elm | module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
-- CSS is really confusing.
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", ... | module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
]
... | Add explanatory text at the bottom | Add explanatory text at the bottom | Elm | mit | marick/static-fp |
6eeb57a1aa935b5717b126b812e19081373580fb | tests/Helper/Filesystem.elm | tests/Helper/Filesystem.elm | module Helper.Filesystem exposing (..)
import Game.Servers.Filesystem.Models exposing (..)
{-| addFileRecursively is a helper because on tests we often want to add a file
in a specific path which *we assume* already exists. On production, we do not assume
this, the path must exists. For a test, however, it's OK to a... | module Helper.Filesystem exposing (addFileRecursively)
import Game.Servers.Filesystem.Models exposing (..)
addFolderReducer : String -> ( Filesystem, String ) -> ( Filesystem, String )
addFolderReducer folderName ( filesystem, path ) =
let
folder =
Folder { id = "id", name = folderName, path ... | Update addFileRecursively to work recursively. | Update addFileRecursively to work recursively.
| Elm | agpl-3.0 | HackerExperience/HEBorn,HackerExperience/HEBorn,HackerExperience/HEBorn |
34e1d9efed0c2dff303ce50789ab63a98e20704a | ViewPhotos.elm | ViewPhotos.elm | module ViewPhotos exposing (viewPhotos)
import Time.Date as Date exposing (Date, Weekday(..), day, month)
import Html exposing (..)
--import Html.Events exposing (onClick)
import Html.Attributes exposing (class, style, title, src)
import Types exposing (..)
import DateUtils exposing (..)
import Dict
viewPhotos : Mo... | module ViewPhotos exposing (viewPhotos)
import Time.Date as Date exposing (Date, Weekday(..), day, month)
import Html exposing (..)
--import Html.Events exposing (onClick)
import Html.Attributes exposing (class, style, title, src)
import Types exposing (..)
import DateUtils exposing (..)
import Dict
viewPhotos : Mo... | Add number of pictures for a specific day | Add number of pictures for a specific day
| Elm | mit | maxf/waterfall,maxf/waterfall,maxf/waterfall,maxf/waterfall |
50941019c3a55bfd03bcf4b0bedfc00a5ff58564 | public/examples/Reactive/Draw.elm | public/examples/Reactive/Draw.elm | -- Try this out on an iOS or Android device by removing "edit"
-- from the URL: http://elm-lang.org/examples/Reactive/Touches.elm
import Dict
import Touch
import Window
main = lift2 scene Window.dimensions
(Dict.values <~ foldp addN Dict.empty Touch.touches)
addN : [Touch.Touch] -> Dict.Dict Int [... |
import Dict
import Touch
import Window
main = lift2 scene Window.dimensions
(Dict.values <~ foldp addN Dict.empty Touch.touches)
addN : [Touch.Touch] -> Dict.Dict Int [(Int,Int)] -> Dict.Dict Int [(Int,Int)]
addN ts dict = foldl add1 dict ts
add1 : Touch.Touch -> Dict.Dict Int [(Int,Int)] -> Dict... | Remove incorrect and redundant comment | Remove incorrect and redundant comment
Thanks @jvoigtlaender!
| Elm | bsd-3-clause | liubko/elm-lang.org,jvoigtlaender/elm-lang.org,yang-wei/elm-lang.org,rtfeldman/elm-lang.org,frankschmitt/elm-lang.org,kevinrood/elm-lang.org,randomer/elm-lang.org,jazmit/elm-lang.org,elm-lang/debug.elm-lang.org,amitaibu/elm-lang.org,randomer/elm-lang.org,elm-lang/debug.elm-lang.org,yang-wei/elm-lang.org,FranklinChen/el... |
4231c142f149c0539be3f79d51927a03eb202396 | public/examples/Intermediate/Clock.elm | public/examples/Intermediate/Clock.elm |
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]... |
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]... | Use fromPolar in clock example | Use fromPolar in clock example | Elm | bsd-3-clause | ThomasWeiser/elm-lang.org,jazmit/elm-lang.org,liubko/elm-lang.org,akeeton/elm-lang.org,eeue56/elm-lang.org,frankschmitt/elm-lang.org,jvoigtlaender/elm-lang.org,kevinrood/elm-lang.org,jazmit/elm-lang.org,amitaibu/elm-lang.org,FranklinChen/elm-lang.org,inchingforward/elm-lang.org,amitaibu/elm-lang.org,yang-wei/elm-lang.o... |
dd5c3ca69a4d3d34cae60261324642301ad656d0 | src/index.elm | src/index.elm | import Html exposing (div, button, text, input, label)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import StartApp as StartApp
import Effects exposing (Effects, Never)
import Maybe exposing (map)
app = StartApp.start { init = (model, Effects.none), view = view, update = update, inputs = ... | import Html exposing (div, button, text, input, label)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import StartApp as StartApp
import Effects exposing (Effects, Never)
import Maybe exposing (map)
app = StartApp.start { init = (emptyModel, Effects.none), view = view, update = update, inpu... | Insert new row with button | Insert new row with button
| Elm | bsd-3-clause | simoraman/liftElm |
1a988a379d73446a95dc0fbe30dd5c08b34da1b0 | example/ticking_port.elm | example/ticking_port.elm | module TickingPort where
import Signal
import Signal ((<~), Signal)
import Time
import Text
import Graphics.Element (Element)
main : Element
main = Text.asText "main"
port messageOut : Signal String
port messageOut = Signal.map toString (Time.every Time.second)
| module TickingPort where
import Time
import Html exposing (text)
main = text "placeholder"
port messageOut : Signal String
port messageOut = Signal.map toString (Time.every Time.second)
| Update ticking port example to modern Elm | Update ticking port example to modern Elm | Elm | mit | sonnym/node-elm-loader,boxdot/node-elm-loader |
b39c8f7da37752578ee3e33264251a3025b1bb9a | public/examples/Intermediate/Clock.elm | public/examples/Intermediate/Clock.elm |
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]... | main = lift clock (every second)
radius = 100
shortHandLength = radius * 0.6
longHandLength = radius * 0.9
clock t = collage 400 400 [ filled lightGrey (circle radius)
, outlined (solid grey) (circle radius)
, hand orange longHandLength t
,... | Make the clock a circle and extract constants | Make the clock a circle and extract constants | Elm | bsd-3-clause | thSoft/elm-lang.org |
32481eb255476a0b0e778608490a5c5cd8020fa6 | simulator/Simulator/Command.elm | simulator/Simulator/Command.elm | module Simulator.Command where
type Move = E | W | SE | SW
type Rotation = CW | CCW
type Command = Move Move | Rotate Rotation
type alias CommandCode = Char
decode : CommandCode -> Maybe Command
decode code =
let
mapping =
[ (['p', '\'', '!', '.', '0', '3'], Move W)
, (['b', 'c', 'e', 'f', 'y', '... | module Simulator.Command where
type Move = E | W | SE | SW
type Rotation = CW | CCW
type Command = Move Move | Rotate Rotation
type alias CommandCode = Char
decode : CommandCode -> Maybe Command
decode code =
let
mapping =
[ (['p', '\'', '!', '.', '0', '3'], Move W)
, (['b', 'c', 'e', 'f', 'y', '... | Fix sequence function which incorrectly reversed the input | Fix sequence function which incorrectly reversed the input
| Elm | bsd-3-clause | mietek/icfp-contest-2015,blax/icfp-contest-2015 |
f680d5db2a4b32252507fe9fdf457f934b42f3f9 | exercises/scrabble-score/tests/Tests.elm | exercises/scrabble-score/tests/Tests.elm | module Tests exposing (tests)
import Expect
import ScrabbleScore exposing (scoreWord)
import Test exposing (..)
tests : Test
tests =
describe "Grains"
[ test "lowercase letter" <|
\() -> Expect.equal 1 (scoreWord "a")
, skip <|
test "uppercase letter" <|
\(... | module Tests exposing (tests)
import Expect
import ScrabbleScore exposing (scoreWord)
import Test exposing (..)
tests : Test
tests =
describe "ScrabbleScore"
[ test "lowercase letter" <|
\() -> Expect.equal 1 (scoreWord "a")
, skip <|
test "uppercase letter" <|
... | Fix Test description for ScrabbleScore | Fix Test description for ScrabbleScore | Elm | mit | exercism/xelm |
463bd5ab7b1ef49db96f69ecf6bf2b726c824ea1 | src/View.elm | src/View.elm | module View exposing (view)
import Html exposing (..)
import Model exposing (Model)
import Msg exposing (Msg)
import Page.Country
import Page.Dish
import Page.Home
import Route exposing (Route (..))
-- VIEW --
view : Model -> Html Msg
view model =
div [] [ page model ]
-- PAGE --
page : Model -> Html Msg
page m... | module View exposing (view)
import Html exposing (..)
import Model exposing (Model)
import Msg exposing (Msg)
import Page.Country
import Page.Dish
import Page.Home
import Route exposing (Route (..))
-- VIEW --
view : Model -> Html Msg
view model =
div [] [ page model ]
-- PAGE --
page : Model -> Html Msg
page m... | Remove 404 text when retrieving data for view | Remove 404 text when retrieving data for view
| Elm | mit | localonomy/www,localonomy/www |
09e82d48691a9546051f7af8b42ce5d40d184f3e | examples/counter.elm | examples/counter.elm | import Monitor
import Signal
import Text
main = Signal.map Text.asText (Signal.foldp (+) 0 Monitor.refresh) | import Monitor
import Signal
import Text
import Mouse
import Graphics.Element (flow, down)
display counter1 counter2 = flow down
[ Text.asText counter1
, Text.asText counter2
]
main = Signal.map2 display
(Signal.foldp (+) 0 Monitor.refresh)
(Signal.foldp (+) 0 (Monitor.refreshWhen Mouse.isDown)) | Update example to use both `refresh` and `refreshWhen`. | Update example to use both `refresh` and `refreshWhen`.
| Elm | bsd-3-clause | jwmerrill/elm-animation-frame |
a194b7c41576bfd869e7b51a31edbd7232927f41 | web/src/Main.elm | web/src/Main.elm | module Main where
import Html exposing (text)
import Http
import Task exposing (Task, andThen)
results : Signal.Mailbox String
results = Signal.mailbox ""
port tasks : Task Http.Error ()
port tasks =
Http.getString "/api/" `andThen` Signal.send results.address
main =
Signal.map text results.signal
type al... | module Main where
import Html exposing (text)
import Http
import Json.Decode exposing ((:=), Decoder, string, int, float, list, object1, object4)
import Task exposing (Task, andThen)
results : Signal.Mailbox String
results = Signal.mailbox ""
port tasks : Task Http.Error ()
port tasks =
Http.getString "/api/" `... | Add Decoder definition for the response. | Add Decoder definition for the response.
| Elm | mit | zsiciarz/skyrim-alchemy-toolbox,zsiciarz/skyrim-alchemy-toolbox,zsiciarz/skyrim-alchemy-toolbox |
1e3ceec3396019f51e5f13e7ed291d79769c879d | src/Main.elm | src/Main.elm | module Main where
import StartApp
import StartApp.Simple as Simple
import Task
import Html exposing (Html)
-- Example 1. Counter
-- import Counter exposing (model, update, view)
-- Example 2. Form Validation
import FormValidator exposing (model, update, view)
-- Example 3. Form Validation and Http request
-- import... | module Main where
import StartApp
import StartApp.Simple as Simple
import Task
import Html exposing (Html)
-- Example 1. Counter
-- import Counter exposing (model, update, view)
-- Example 2. Form Validation
-- import FormValidator exposing (model, update, view)
-- Example 3. Form Validation and Http request
import... | Use github photo fetcher as index | Use github photo fetcher as index
| Elm | mit | Rhadow/elm-demo,Rhadow/elm-demo |
2edcced71358860cea84bc7d3ac0ccb3997fd11c | libraries/Maybe.elm | libraries/Maybe.elm | module Maybe where
{-| Represents an optional value.
# Type and Constructors
@docs Maybe
# Taking Maybes apart
@docs maybe, isJust, isNothing
# Maybes and Lists
@docs cons, justs
-}
import Basics (not, (.))
import List (foldr)
{-| The Maybe datatype. Useful when a computation may or may not
result in a value ... | module Maybe where
{-| Represents an optional value. Maybe it is there, maybe it is not.
# Type and Constructors
@docs Maybe
# Taking Maybes apart
@docs maybe, isJust, isNothing
# Maybes and Lists
@docs cons, justs
-}
import Basics (not, (.))
import List (foldr)
{-| The Maybe datatype. Useful when a computation m... | Add a bit more to intro of documentation | Add a bit more to intro of documentation
| Elm | bsd-3-clause | deadfoxygrandpa/Elm,JoeyEremondi/elm-pattern-effects,laszlopandy/elm-compiler,5outh/Elm,pairyo/elm-compiler,mgold/Elm,Axure/elm-compiler |
78caa753c65eb8afdc81de86a78f7520c1e7e0a0 | src/KeyValueRecords.elm | src/KeyValueRecords.elm | module Main exposing (..)
import Html exposing (text)
main =
text "Hi Records!"
| module Main exposing (..)
import Html exposing (text)
type alias Dog =
{ name: String
, age: Int
}
dog =
{ name = "Spock"
, age = 3
}
renderDog : Dog -> String
renderDog dog =
dog.name
++ " - "
++ (toString dog.age)
main =
text <| renderDog dog
| Store records, and refer to with type signatures | Store records, and refer to with type signatures
| Elm | mit | mtheoryx/elm-hello-world,mtheoryx/elm-hello-world |
8f36f9367a4f1b27c0712d11a509f44e9e8e713b | elm/Decoders.elm | elm/Decoders.elm | module Decoders exposing (..)
import Grid
import Json.Decode as Decode exposing (Decoder)
import Types exposing (..)
localStorageModelDecoder : Decoder LocalStorageModel
localStorageModelDecoder =
Decode.map3 LocalStorageModel
(Decode.field "givenUp" Decode.bool)
(Decode.field "grid" gridDecoder)... | module Decoders exposing (..)
import Grid
import Json.Decode as Decode exposing (Decoder)
import Types exposing (..)
localStorageModelDecoder : Decoder LocalStorageModel
localStorageModelDecoder =
Decode.map3 LocalStorageModel
(Decode.field "givenUp" Decode.bool)
(Decode.field "grid" gridDecoder)... | Fix decoder fallback grid size | Fix decoder fallback grid size
| Elm | mit | lydell/elm-minesweeper,lydell/elm-minesweeper |
81acc5501f2a535201dbad7e733113bd362922c2 | examples/hello-world/Main.elm | examples/hello-world/Main.elm | module Main exposing (..)
import Browser
import Html exposing (Html, text)
import Material
import Material.Button as Button
import Material.Options as Options
type alias Model =
{ mdc : Material.Model Msg
}
defaultModel : Model
defaultModel =
{ mdc = Material.defaultModel
}
type Msg
= Mdc (Ma... | module Main exposing (..)
import Browser
import Html exposing (Html, text)
import Material
import Material.Button as Button
import Material.Options as Options
type alias Model =
{ mdc : Material.Model Msg
}
defaultModel : Model
defaultModel =
{ mdc = Material.defaultModel
}
type Msg
= Mdc (Ma... | Make hello world button look better | Make hello world button look better
| Elm | apache-2.0 | aforemny/elm-mdc |
1454951f4fcb1161f7d8b649de13943f6dbd1d02 | tests/test-files/good/AllSyntax.elm | tests/test-files/good/AllSyntax.elm | module AllSyntax where
import String
import Signal exposing (foldp, map)
import Json.Decode as Json
import List exposing (..)
fn =
"XYZZY"
annotatedFn : String
annotatedFn =
"XYZZY"
inlinePipeline =
1 |> (+) 2
tuple =
(1, 2)
commentedLiterals =
({- int -} 1, {- float -} 0.1, {- char -} 'c... | module AllSyntax where
import String
import Signal exposing (foldp, map)
import Json.Decode as Json
import List exposing (..)
fn =
"XYZZY"
annotatedFn : String
annotatedFn =
"XYZZY"
inlinePipeline =
1 |> (+) 2
tuple =
(1, 2)
commentedLiterals =
({- int -} 1, {- float -} 0.1, {- char -} 'c... | Add test for infix operators | Add test for infix operators
| Elm | bsd-3-clause | nukisman/elm-format-short,fredcy/elm-format,avh4/elm-format,avh4/elm-format,fredcy/elm-format,nukisman/elm-format-short,nukisman/elm-format-short,fredcy/elm-format,avh4/elm-format,nukisman/elm-format-short,avh4/elm-format,nukisman/elm-format-short |
08dd3d292bc2e437aaf98d1286445eac92884582 | exercises/armstrong-numbers/ArmstrongNumbers.example.elm | exercises/armstrong-numbers/ArmstrongNumbers.example.elm | module ArmstrongNumbers exposing (check)
check : Int -> Bool
check nb =
let
( digits, nbDigits ) =
digitsAndLength nb
in
nb
== List.foldl (+)
0
(List.map (\a -> a ^ nbDigits) digits)
digitsAndLength : Int -> ( List Int, Int )
digitsAndLength nb =
i... | module ArmstrongNumbers exposing (check)
check : Int -> Bool
check nb =
let
( digits, nbDigits ) =
digitsAndLength nb
in
nb == List.sum (List.map (\a -> a ^ nbDigits) digits)
digitsAndLength : Int -> ( List Int, Int )
digitsAndLength nb =
if nb < 10 then
( [ nb ], 1 )
... | Replace List.foldl (+) 0 by List.sum | Replace List.foldl (+) 0 by List.sum
| Elm | mit | exercism/xelm |
8d7cf8e85475bfa12434ed0f93069fd6c104c4ac | tests/fixtures/0.19.0/PortModuleA.elm | tests/fixtures/0.19.0/PortModuleA.elm | {-| A port module -}
port module PortModuleA exposing (portA)
{-| @docs portA -}
{-| some port A -}
port portA : Cmd ()
| port module PortModuleA exposing (portA)
{-| @docs portA -}
{-| some port A -}
port portA : Cmd ()
| Revert messing with rogue comments in test fixture | Revert messing with rogue comments in test fixture
| Elm | bsd-3-clause | ento/elm-doc,ento/elm-doc |
d4f0ac9660d9cce8a3b2ee28e75808171296a977 | src/BoardHelpers.elm | src/BoardHelpers.elm | module BoardHelpers exposing (..)
import Models exposing (..)
getBoardByStorageKey : List TrelloBoard -> String -> Maybe TrelloBoard
getBoardByStorageKey boards key =
case getBoardIdByStorageKey key of
Just id ->
getBoardById boards id
Nothing ->
Nothing
getBoardIdBySto... | module BoardHelpers exposing (..)
import Models exposing (..)
getBoardByStorageKey : List TrelloBoard -> String -> Maybe TrelloBoard
getBoardByStorageKey boards key =
key
|> getBoardIdByStorageKey
|> Maybe.andThen (getBoardById boards)
getBoardIdByStorageKey : String -> Maybe String
getBoardIdB... | Use Maybe.andThen instead of case | Use Maybe.andThen instead of case
| Elm | mit | mattiaslundberg/trellooverview,mattiaslundberg/trellooverview |
1b4f08a1783327b999691b6829f8e4da56f44c53 | tests/NewtonsMethodTest.elm | tests/NewtonsMethodTest.elm | module NewtonsMethodTest exposing (..)
import Expect exposing (Expectation)
import Test exposing (Test, describe, test)
breakEvenPoint : (Float -> Float) -> Maybe Float
breakEvenPoint func =
let
y0 =
func 0
rise =
func 1 - y0
in
case rise of
0 ->
... | module NewtonsMethodTest exposing (..)
import Expect exposing (Expectation)
import Test exposing (Test, describe, test)
import TestSupport exposing (checkMaybe, closeTo)
breakEvenPoint : (Float -> Float) -> Maybe Float
breakEvenPoint func =
let
y0 =
func 0
rise =
func 1 -... | Introduce checkMaybe to be able to use closeTo | Introduce checkMaybe to be able to use closeTo
| Elm | mit | 7er/elm-nka,7er/elm-nka,7er/elm-nka |
a94eb31a5551883c26480087098fa7c537cb5884 | src/MyList.elm | src/MyList.elm | module MyList
(
)
where
getAt : List a -> Int -> Maybe a
getAt list index =
List.head <| List.drop index list
removeAt : List a -> Int -> Maybe a
removeAt list index =
if index < length list then
Maybe.Just <| (take index list) ++ (drop (index + 1) list)
else
Nothing
{-
mov... | Add a module for extra List functions | Add a module for extra List functions
| Elm | bsd-2-clause | akeeton/nickel-havana,akeeton/nickel-havana,akeeton/nickel-havana | |
2462ffff5a5a72b5f5b7b83e72822017d5f15653 | src/Bootstrap.elm | src/Bootstrap.elm | module Bootstrap exposing (..)
import Html exposing (div, nav, a, img, Html, Attribute)
import Html.Attributes exposing (class, alt, src)
row : List (Html msg) -> Html msg
row elements =
div [ class "row" ] elements
navbar : List (Attribute msg) -> List (Html msg) -> Html msg
navbar attributes elements =
n... | Add dedicated module to bootstrap helpers | Add dedicated module to bootstrap helpers
| Elm | mit | oleiade/patron,oleiade/patron | |
c71cccb00ff5dfeae4b409fa82428aea13ab5dd8 | frontend/Page/PackageDocs.elm | frontend/Page/PackageDocs.elm | module Page.PackageDocs where
import Basics (..)
import Color
import ColorScheme as C
import Dict
import Json
import Graphics.Element (..)
import Http
import List
import List ((++))
import Maybe (..)
import Result
import Signal
import String
import Window
import Component.TopBar as TopBar
import Component.PackageDocs... | Add page for package overviews | Add page for package overviews
| Elm | bsd-3-clause | jvoigtlaender/package.elm-lang.org,itsgreggreg/package.elm-lang.org,mgold/package.elm-lang.org,Dedoig/package.elm-lang.org | |
6eb83c2992603a426068eaebdbfd18cb1d929197 | src/Crypto/AesCbc.elm | src/Crypto/AesCbc.elm | module AesCbc
( CryptoKey, encrypt, decrypt
, generateKey, importKey, exportKey
, wrapKey, unwrapKey
) where
{-| This module wraps the AES-CBC mode of encryption in the web crypto API
@docs CryptoKey
@docs encrypt, decrypt
@docs KeySize
@docs generateKey, importKey, exportKey
@docs wrapKey, unwrap... | Add scaffolding for cipher separation | Add scaffolding for cipher separation
| Elm | bsd-3-clause | Strikeskids/elm-crypto | |
c761e68c2525bb4dfd7ad469d64fccc8c01200cb | Example.elm | Example.elm | -- Basic ElmFire Example App
import Html exposing (Html, div, input, output, label, text, a)
import Html.Events exposing (on, targetValue)
import Html.Attributes exposing (href, target)
import Signal exposing (Signal, Mailbox, mailbox, message)
import Task exposing (Task)
import Json.Encode exposing (string)
import E... | Add a basic ElmFire example | Add a basic ElmFire example
Example.elm
Lets you write a string to a Firebase location.
At the same time this location is queried and any change is shown in the page. | Elm | bsd-3-clause | ThomasWeiser/elmfire,ThomasWeiser/elmfire | |
4fbf7ebb1258c82056b52c6d7ef8cd29ebc11081 | IdeaFight/ForestTest.elm | IdeaFight/ForestTest.elm | import Html.App as App
import Html exposing (Html)
import IdeaFight.PartialForest as Forest
import IdeaFight.Shuffle as Shuffle
import Random
import Time
type alias Model = Forest.Forest Int
type Msg = ShuffleMe (List Int) | Tick
stepForest : Forest.Forest comparable -> Forest.Forest comparable
stepForest forest =
... | Create a test wrapper for the forest module | Create a test wrapper for the forest module
Just so I don't have to keep clicking buttons
| Elm | mit | hoelzro/idea-fight | |
a89ff7548ce2909003a94befcf68ccad76e8a158 | test/listTest.elm | test/listTest.elm | module ListTest exposing (..)
{-| Rolls a die many times and collates the output. Judging whether the result is sufficiently random
is wholly unscientific; this test is really to show that independent seeds aren't *trivially* wrong.
-}
import Dict exposing (Dict)
import Random.Pcg as Random
import Html
import Html.Ap... | Add a simple test to show output of die rolls | Add a simple test to show output of die rolls
| Elm | bsd-3-clause | mgold/elm-random-pcg,mgold/elm-random-pcg,mgold/elm-random-pcg | |
3640376be8cbb78c70765e1baf7d0e7de2ce407c | tests/test-files/good/Ports.elm | tests/test-files/good/Ports.elm |
-- incoming
port userID : String
port signal : Signal Int
port tuple : (Float,Bool)
port array : [Int]
port record : { x:Float, y:Float }
-- outgoing
port fortyTwo : Int
port fortyTwo = 42
port time : Signal Float
port time = every second
port students : Signal [{name:String, age:Int}]
port students = constant [] | Add a test for port parsing and types | Add a test for port parsing and types
Partly addressing #442
| Elm | bsd-3-clause | JoeyEremondi/elm-pattern-effects,mgold/Elm,pairyo/elm-compiler,5outh/Elm,deadfoxygrandpa/Elm,laszlopandy/elm-compiler,Axure/elm-compiler | |
64e88fd24b50a2c224f3cd158cdc54975672a124 | Examples/elm-js/GameSkeleton/GameSkeleton.elm | Examples/elm-js/GameSkeleton/GameSkeleton.elm |
module GameSkeleton where
{-- Part 1: Model the user input ----------------------------------------------
What information do you need to represent all relevant user input?
Task: Redefine `UserInput` to include all of the information you need.
Redifene `userInput` to be a signal that correctly models the us... | Add Game Skeleton for easy game making. | Add Game Skeleton for easy game making.
| Elm | bsd-3-clause | pairyo/elm-compiler,mgold/Elm,laszlopandy/elm-compiler,deadfoxygrandpa/Elm,Axure/elm-compiler,JoeyEremondi/elm-pattern-effects,5outh/Elm | |
836e5dfba006322876f83b1b5d0aab64b063962a | client/Api.elm | client/Api.elm | module Api where
import Http
import Json.Decode exposing ((:=))
import Json.Encode
import Task exposing (Task)
type alias Request
= { amount: Int
, num_years: Int
, apr: Float
}
type alias Response
= { stats: Stats }
type alias Stats
= { monthly_repayment: Float }
getStats : Request -> Task Http.... | Add module for doing API requests | Add module for doing API requests
| Elm | mit | matt-thomson/mortgage,matt-thomson/mortgage | |
4ed38d454e5f04784224c738149b5cb21badd4f8 | doc/images/FillsAndStrokes.elm | doc/images/FillsAndStrokes.elm | module FillsAndStrokes exposing (..)
import Svg
import Svg.Attributes as Attributes
whiteFill : Svg.Attribute msg
whiteFill =
Attributes.fill "white"
greyFill : Svg.Attribute msg
greyFill =
Attributes.fill "grey"
noFill : Svg.Attribute msg
noFill =
Attributes.fill "none"
blackStroke : Svg.Attribute... | Add utility module with common SVG styles | Add utility module with common SVG styles
| Elm | mpl-2.0 | opensolid/geometry | |
b3a8782237473cd55cb8939cfa3f5e682df716b0 | src/SetExtensions.elm | src/SetExtensions.elm | module SetExtensions exposing (unionMap)
import Set exposing (Set)
unionMap : (comparable -> Set comparable) -> Set comparable -> Set comparable
unionMap mapping source =
Set.foldl (reducer mapping) Set.empty source
reducer : (comparable -> Set comparable) -> comparable -> Set comparable -> Set comparable... | Add unionMap convenience method for mapping over Sets | Add unionMap convenience method for mapping over Sets
| Elm | mit | nafarlee/elm-game-of-life | |
c19084f845d717e169b9dd15fee10f4deb3788cf | etc/WidgetContainer.elm | etc/WidgetContainer.elm | module WidgetContainer
( WidgetContainer
, Action
, init
, update
, view
)
where
import Html exposing (..)
import Widget exposing (Widget)
type alias WidgetContainer =
{ widgets: List Widget
}
type Action
= DoNothing
| WidgetAction (Widget.Action)
init : List Widget -... | Add template for creating a container of things | Add template for creating a container of things
| Elm | bsd-2-clause | akeeton/nickel-havana,akeeton/nickel-havana,akeeton/nickel-havana | |
eba673820e9f31510c0526771bba8c6e3ee27c4f | src/Position.elm | src/Position.elm | module Position
( mouseTouch
, Position
) where
import Mouse
import Signal exposing (Signal)
import Touch
type alias Position = Maybe (Int, Int)
mouseTouch : Signal Position
mouseTouch =
let mouse = Signal.map Just Mouse.position
touch =
Signal.map (Maybe.map toPair << List.head) Touch.touche... | Add module to get mouse and touch positions at once | Add module to get mouse and touch positions at once
| Elm | mit | igrep/lovely-commune,igrep/lovely-commune,igrep/lovely-commune | |
1c10f54ab82c830c39e7d0bd25c33b847b18c4f0 | tests/Test/Runner/Tests.elm | tests/Test/Runner/Tests.elm | module Test.Runner.Tests exposing (all)
import Expect
import Fuzz exposing (..)
import Test exposing (..)
import Test.Runner exposing (SeededRunners(..))
import Random.Pcg as Random
all : Test
all =
Test.concat
[ fromTest ]
-- fromTest : Int -> Random.Pcg.Seed -> Test -> SeededRunners
-- fromTest runs... | Add some Test Runner tests. | Add some Test Runner tests.
| Elm | bsd-3-clause | elm-community/elm-test | |
4f1e13d0521616e2a5e892dae6d639546544b5da | frontend/public/examples/Elements/Markdown.elm | frontend/public/examples/Elements/Markdown.elm | import Markdown
main = Markdown.toElement """
# Welcome to Elm
This [markdown](http://daringfireball.net/projects/markdown/)
parser lives in the [elm-markdown][] package, allowing you to
generate `Element` and `Html` blocks.
[elm-markdown]: http://package.elm-lang.org/packages/evancz/elm-markdown/latest
""" | Add back markdown example, point to package | Add back markdown example, point to package
| Elm | bsd-3-clause | amitaibu/elm-lang.org,elm-guides/elm-lang.org,rtfeldman/elm-lang.org,randomer/elm-lang.org,FranklinChen/elm-lang.org,amitaibu/elm-lang.org,jazmit/elm-lang.org,randomer/elm-lang.org,jvoigtlaender/elm-lang.org,frankschmitt/elm-lang.org,kevinrood/elm-lang.org,liubko/elm-lang.org,inchingforward/elm-lang.org,coreyhaines/elm... | |
510f5f314adb4d4c021ddb2172d731a517569369 | tests/Generic/Curve2d.elm | tests/Generic/Curve2d.elm | module Generic.Curve2d
exposing
( scaling
, translation
)
import Fuzz exposing (Fuzzer)
import OpenSolid.Geometry.Expect as Expect
import OpenSolid.Geometry.Fuzz as Fuzz
import OpenSolid.Point2d as Point2d exposing (Point2d)
import OpenSolid.Vector2d as Vector2d exposing (Vector2d)
import T... | Add module for testing generic curve-like values | Add module for testing generic curve-like values
Generic tests like "rotating a curve and then evaluating should be equivalent to evaluating and then rotating"
| Elm | mpl-2.0 | opensolid/geometry | |
12f6032b7a5803304a58c270452c54c2970953f8 | src/Utils/List.elm | src/Utils/List.elm | module Utils.List exposing (move, indexedFoldl, indexedFoldr)
move : Int -> Int -> List a -> List a
move from to list =
-- TODO: clear this function
let
reducer append i next ( state, found, list ) =
if state == 0 && from == i then
( 1, Just next, list )
else if... | Add a move list item by index function. | Add a move list item by index function.
| Elm | agpl-3.0 | HackerExperience/HEBorn,HackerExperience/HEBorn,HackerExperience/HEBorn | |
64b92af8b4310000bddbdc5307cf20906a187748 | tests/fixtures/tests/Passing/Unexposed.elm | tests/fixtures/tests/Passing/Unexposed.elm | module Passing.Unexposed exposing (all)
import Expect
import Test exposing (..)
all : Test
all =
describe "all"
[ test "Expect.equal works" <|
\() ->
"success"
|> Expect.equal "success"
, testTrue
]
testTrue : Test
testTrue =
test "Exp... | Add test for unexposed test | Add test for unexposed test
| Elm | bsd-3-clause | rtfeldman/node-elm-test,rtfeldman/node-test-runner,rtfeldman/node-elm-test | |
5a9e3050ff784c2e62a2de5021b8b4aea8fcbdc1 | examples/TextReverser.elm | examples/TextReverser.elm | module TextReverser where
import Graphics.Input as Input
import Html (Html, CssProperty, style, prop, text, on, getValue, toElement)
import Html.Tags (div, input)
import Html.Attributes (..)
import String
-- VIEW
scene : String -> Element
scene string =
toElement 400 200 (stringReverser string)
stringReverser... | Add a new example that tests text input | Add a new example that tests text input
| Elm | bsd-3-clause | thSoft/virtual-dom,shaydon/virtual-dom,wildlyinaccurate/virtual-dom,laszlopandy/virtual-dom,shaydon/virtual-dom,jadski/virtual-dom,GlenDC/virtual-dom,evancz/virtual-dom,GlenDC/virtual-dom,ajnsit/virtual-dom,seanhess/virtual-dom,evancz/virtual-dom,laszlopandy/virtual-dom,ajnsit/virtual-dom,seanhess/virtual-dom,thSoft/vi... | |
056313cfb292a108226bcafcb231bcb6377ac36b | src/OpenSolid/Core/Encode.elm | src/OpenSolid/Core/Encode.elm | module OpenSolid.Core.Encode (interval, vector2d, vector3d, direction2d, direction3d, point2d, point3d, boundingBox2d, boundingBox3d, axis2d, axis3d, plane3d, frame2d, frame3d) where
{-| JSON encoders for the core OpenSolid types.
-}
import Json.Encode exposing (..)
import OpenSolid.Core.Types exposing (..)
| Add skeleton file for JSON encoders | Add skeleton file for JSON encoders
| Elm | mpl-2.0 | opensolid/geometry | |
8391c6db5d4f5bf3b593fefbb61432383596420f | media/src/ConvexHull.elm | media/src/ConvexHull.elm | module ConvexHull exposing (..)
import Html exposing (Html)
import Html.Events
import OpenSolid.BoundingBox2d as BoundingBox2d exposing (BoundingBox2d)
import OpenSolid.Point2d as Point2d exposing (Point2d)
import OpenSolid.Polygon2d as Polygon2d
import OpenSolid.Svg as Svg
import Random exposing (Generator)
import Sv... | Add visual test of convex hull construction | Add visual test of convex hull construction
Click on diagram to generate a new one!
| Elm | mpl-2.0 | opensolid/geometry | |
2f0240d5fdb0167dca3e1dafddc29711abc97ac9 | Arc.elm | Arc.elm | module Arc where
import Color as C
import Graphics.Collage as GC
import List as L
import Mouse
import Signal ((<~))
cX = 1000
cY = 500
main = plotArc 5 (0, 0) << canvasCoords <~ Mouse.position
canvasCoords : (Int, Int) -> (Float, Float)
canvasCoords (x, y) = (toFloat x - cX/2, cY/2 - toFloat y)
plotArc h head tail... | Create a function that draw an arc given the two endpoints and the maximum displacement from a straight line. | Create a function that draw an arc given the two endpoints and the maximum displacement from a straight line.
Arc.elm contains the arc function and a demo main function
| Elm | mit | nphollon/palmyra | |
02aa568c0e9f7fac77276081c3e78f03c1cda545 | load/md.el | load/md.el | (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-hook
'markdown-mode-hook
(lambda ()
(local-unset-key (kbd "<backtab>"))))
| (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-hook
'markdown-mode-hook
(lambda ()
(local-unset-key (kbd "<backtab>"))
(defvar markdown-indent-on-enter "markdown-mode.el")
(setq markdown-indent-on-enter nil)))
| Disable indent on newline for markdown files | Disable indent on newline for markdown files
| Emacs Lisp | mit | kaidadragonfly/.emacs |
7fb9c399ec466a53623046cfc9a2154e078bbcaa | dotfiles/spacemacs.d/sql-indent-config.el | dotfiles/spacemacs.d/sql-indent-config.el | (defun configure-sql-indentation ()
"Configure the indentation settings for `sqlind-minor-mode'."
(require 'sql-indent-left)
(setq
sqlind-basic-offset 2
sqlind-indentation-offsets-alist `((in-select-clause +)
(select-join-condition +)
... | (defun configure-sql-indentation ()
"Configure the indentation settings for `sqlind-minor-mode'."
(require 'sql-indent-left)
(setq
sqlind-basic-offset 2
sqlind-indentation-offsets-alist
`((in-select-clause +)
(select-join-condition +)
(nested-statement-open sqlind-use-anchor-indentation +)
... | Indent by a fixed amount inside parens | Indent by a fixed amount inside parens
| Emacs Lisp | mit | razzolini/dotfiles,razzolini/dotfiles,razzolini/dotfiles |
28e6239472ee4c19385d03a74aafa30d797363db | site-lisp/linc01n-gui.el | site-lisp/linc01n-gui.el | ; ~/.emacs.d/my-gui.el
;; Remove scrollbars, menu bars, and toolbars
; when is a special form of "if", with no else clause, it reads:
; (when <condition> <code-to-execute-1> <code-to-execute2> ...)
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(when (fboundp 'scr... | ;; Remove scrollbars, menu bars, and toolbars
(unless (eq window-system 'mac)
(when (and (fboundp 'menu-bar-mode) (not (eq menu-bar-mode -1)))
(menu-bar-mode -1)))
(when (and (fboundp 'scroll-bar-mode) (not (eq scroll-bar-mode -1)))
(scroll-bar-mode -1))
(when (and (fboundp 'tool-bar-mode) (not (eq tool-bar-mo... | Add tooltip mode to remove tooltips | Add tooltip mode to remove tooltips
| Emacs Lisp | mit | linc01n/.emacs.d,linc01n/.emacs.d |
04b8c39d44b2f87ba460fd06c7bae514809317ad | tag-emacs-next/emacs.d/features/init-system.el | tag-emacs-next/emacs.d/features/init-system.el | ;; modernizing Emacs' Package Menu
;; with package ratings, usage statistics, customizability, and more
(use-package paradox
:defer 0.1
:init
(setq
paradox-github-token "5572ad3a003df76865d5a039b4a2152452c8aff9"
paradox-execute-asynchronously t
paradox-automatically-star t)
:config
;; replace the def... | ;; modernizing Emacs' Package Menu
;; with package ratings, usage statistics, customizability, and more
(use-package paradox
:defer 0.1
:init
(setq
paradox-execute-asynchronously t
paradox-automatically-star t)
:config
;; replace the default interface with paradox
(paradox-enable))
(use-package exec-... | Remove revoken oauth token lol | Remove revoken oauth token lol
| Emacs Lisp | mit | vyorkin-personal/d,vyorkin-personal/d,vyorkin-personal/d,vyorkin-personal/d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.