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
// @inline export mergeRecord arity=7 | |
// @inline export mergeRecordRhsSkip arity=1 | |
// @inline export mergeRecordRhsCons arity=5 | |
// @inline export mergeRecordRhsNil always | |
const mergeRecord = () => () => () => () => () => () => dictMergeRecordRhs => ({merge: a => b => dictMergeRecordRhs.mergeRecordRhs(a)(b)}); | |
const merge = dict => dict.merge; | |
const test1 = {bar: false, foo: 12}; | |
const test2 = v => ({...v, bar: false}); | |
const test3 = v => ({bar: v.bar, foo: 12}); | |
export {merge, mergeRecord, test1, test2, test3}; |
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 CodegenWalkthrough where | |
import Prelude | |
import Control.Alternative (guard) | |
import Control.Monad.Writer (tell) | |
import Data.Array as Array | |
import Data.Foldable (for_) | |
import Data.Maybe (Maybe(..)) | |
import Data.Newtype (unwrap) |
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 Main where | |
import Prelude | |
import Data.Symbol (class IsSymbol) | |
import Prim.Row as Row | |
import Prim.RowList as RowList | |
import Record as Record | |
import Type.Proxy |
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
-- Copyright 2021 Nathan Faubion | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is | |
-- furnished to do so, subject to the following conditions: | |
-- | |
-- The above copyright notice and this permission notice shall be included in |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Array slice loop</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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 Main where | |
import Prelude | |
import Data.Array as Array | |
import Data.Lazy as L | |
import Partial.Unsafe (unsafePartial) | |
newtype Producer f a = Producer (f (Step f a)) | |
data Step f a = Cons a (Producer f a) | Nil |
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 Main where | |
import Prelude | |
import Data.Array as Array | |
import Partial.Unsafe (unsafePartial) | |
data Slice a = Slice (Array a) Int Int | |
fromArray :: forall a. Array a -> Slice a | |
fromArray arr = Slice arr 0 (Array.length arr) |
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
package org.purescript.corefn; | |
import com.fasterxml.jackson.annotation.JsonFormat; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | |
import com.fasterxml.jackson.annotation.JsonSubTypes; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo.As; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; |
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 Main where | |
import Prelude | |
import Effect | |
import Effect.Console | |
import Run | |
import Run.Except | |
import Data.Functor.Variant as VariantF | |
import Data.String as String |
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 Main where | |
import Prelude | |
import Effect | |
import Effect.Console | |
import Effect.Ref as Ref | |
import TryPureScript | |
makeCounter :: Effect (Effect Int) |
NewerOlder