Skip to content

Instantly share code, notes, and snippets.

Daniel Díaz Carrete danidiaz

  • Softtek
  • A Coruña, Spain
Block or report user

Report or block danidiaz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danidiaz
danidiaz / CR001RotatingColorfulSquares.hs
Last active Jul 3, 2019
Codeworld-Reflex experiments
View CR001RotatingColorfulSquares.hs
{-# LANGUAGE BlockArguments #-}
import CodeWorld.Reflex
import Reflex
-- Move mouse to rotate squares.
-- Click to add squares.
positions :: [(Color,(Double,Double))]
positions = zip assortedColors [(0,0),(2,2),(-2,2),(-2,-2),(2,-2)]
View _GraalVM.md

React Server Side Rendering with GraalVM for Clojure. tweet

Note that you aren't tied to Java 8, which is quite old by now, but can also run GraalJS with OpenJDK 11, 12, 13, and enjoy the recent performance improvements to the GC (using ZGC or Shenandoah) and startup time (using Application CDS):

Graal-dev here,

We are working with a very high priority on JDK 11 support. We should be able to ship it in a few months from now.

  • So is graal polyglot already compatible with newer JDKs and it's just native image generation that's blocking the upgrade?
View Rocs.hs
-- cabal v2-repl -b "transformers" -b "red-black-record" -b "sop-core" -b "managed" -b "profunctors" -b "aeson" -b "text"
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
@danidiaz
danidiaz / Ctors.hs
Last active Mar 2, 2019
adding and pruning ctors
View Ctors.hs
{-# LANGUAGE DataKinds, TypeApplications #-}
{-# OPTIONS_GHC -Wno-partial-type-signatures #-}
module Main where
import Data.RBR (FromList,Insert,Delete,Variant,I,injectSubset,widen,injectI,winnowI,prettyShowVariantI)
import GHC.TypeLits
-- would defining these as nullary type families improve things?
type Phase01 = FromList '[ '("ctor1",Int), '("ctor2",Bool), '("ctor3",Char) ]
@danidiaz
danidiaz / cpure_NP.hs
Last active Jan 19, 2019
cpure_NP example
View cpure_NP.hs
{-# LANGUAGE DataKinds, TypeApplications #-}
-- http://hackage.haskell.org/package/sop-core
module Main where
import Data.SOP
import Data.SOP.NP (cpure_NP,cliftA_NP,collapse_NP)
import Data.Default
import Data.Proxy
-- NP is an n-ary product indexed by a type-level list. Each value is wrapped in an identity functor I.
@danidiaz
danidiaz / AKindClass.hs
Created Jan 18, 2019
kind class example
View AKindClass.hs
{-# LANGUAGE RankNTypes, DataKinds, TypeInType, PolyKinds, FlexibleInstances #-}
import Data.Proxy
import GHC.TypeLits
class Foo k
class Foo k => Bar (a :: k) where
baz :: Proxy a -> String
instance Foo k => Bar (a :: k) where
baz _ = "baz"
@danidiaz
danidiaz / WrappedFields.hs
Last active Dec 28, 2018
wrap all the fields of a record in a functor, and still allow indexing by field name
View WrappedFields.hs
{-# LANGUAGE DataKinds,
TypeFamilies,
FlexibleInstances,
UndecidableInstances,
ScopedTypeVariables,
TypeApplications,
TypeOperators,
MultiParamTypeClasses,
FunctionalDependencies,
AllowAmbiguousTypes,
@danidiaz
danidiaz / TypeLevelSymbolSet.hs
Last active Dec 26, 2018
A type-level symbol set.
View TypeLevelSymbolSet.hs
{-# LANGUAGE DataKinds,
PolyKinds,
TypeFamilies,
UndecidableInstances,
FlexibleContexts,
ScopedTypeVariables,
TypeApplications,
TypeOperators,
ExistentialQuantification,
DeriveFunctor,
View FieldsPresentOrNot.hs
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE UndecidableInstances #-}
module Main where
View _Architecture.md

Vertical decomposition. Creating cohesive services

One of the biggest misconceptions about services is that a service is an independent deployable unit, i.e., service equals process. With this view, we are defining services according to how components are physically deployed. In our example, since it’s clear that the backend admin runs in its own process/container, we consider it to be a service.

But this definition of a service is wrong. Rather you need to define your services in terms of business capabilities. The deployment aspect of the system doesn’t have to be correlated to how the system has been divided into logical services. For example, a single service might run in different components/processes, and a single component might contain parts of multiple services. Once you start thinking of services in terms of business capabilities rather than deployment units, a whole world of options open.

What are the Admin UI

You can’t perform that action at this time.