This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
module Main where | |
import Control.Monad.State | |
import Control.Monad.Except | |
import Control.Applicative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
module Main where | |
import Control.Monad.State | |
import Control.Monad.Except | |
import Control.Applicative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- code | |
parseEventPayload :: forall opcode event. Sing opcode -> Sing event -> Value -> Parser (Payload opcode event) | |
parseEventPayload SHello SNothing val = | |
HelloPayload <$> parseJSON val | |
parseEventPayload SDispatch (SJust SREADY) val = | |
ReadyPayload <$> parseJSON val | |
parseEventPayload SDispatch (SJust SCHANNEL_CREATE) val = | |
ChannelCreatePayload <$> parseJSON val | |
parseEventPayload SDispatch (SJust SCHANNEL_UPDATE) val = | |
ChannelUpdatePayload <$> parseJSON val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
module PluginTest where | |
import Control.Monad | |
import Data.Aeson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module Plugins where | |
import Control.Monad | |
import Data.Aeson | |
import Data.Aeson.Types | |
import GHC.Generics | |
data EventType | |
= FooEvent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo where | |
import System.Random | |
data Tree a | |
= Tree a (Tree a) (Tree a) | |
| Leaf | |
deriving (Functor, Foldable, Traversable, Show) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Figwheel: Cutting some fruit, just a sec ... | |
Figwheel: Validating the configuration found in project.clj | |
[32mFigwheel: Configuration Valid ;)[0m | |
Figwheel: Starting server at http://0.0.0.0:3449 | |
Figwheel: Watching build - dev | |
[0mCompiling "resources/public/js/compiled/app.js" from ["src/cljs"]...[0m | |
WARNING: Use of undeclared Var clojure.walk/defn at line 37 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs | |
WARNING: Use of undeclared Var clojure.walk/walk at line 37 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs | |
WARNING: Use of undeclared Var clojure.walk/inner at line 44 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs | |
WARNING: Use of undeclared Var clojure.walk/outer at line 44 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// axios is installed via `yarn add axios`, so I'm not entirely sure if this is needed. | |
// import axios from 'axios'; | |
// The auto-generated functions all have this form | |
var getUser = function() | |
{ | |
return axios({ url: '/user' | |
, method: 'get' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// axios is installed via `yarn add axios`, so I'm not entirely sure if this is needed. | |
// import axios from 'axios'; | |
// This doesn't seem to work either | |
// function getUser() | |
// { | |
// return axios({ url: '/user' | |
// , method: 'get' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Proxy | |
data UTCTime | |
data ID a | |
data GenTable a | |
data Connection |