Questions tagged [vinyl]

Vinyl is a general solution to the records problem in Haskell using type level strings and other modern GHC features, featuring static structural typing (with a subtyping relation), and automatic row-polymorphic lenses.

Vinyl is a general solution to the records problem in Haskell using type level strings and other modern GHC features, featuring static structural typing (with a subtyping relation), and automatic row-polymorphic lenses. All this is possible without Template Haskell.

23 questions
9
votes
1 answer

Vinyl: compose record type aliases

In Vinyl, I can define a type alias for a record to make it easier to export to other modules: import Data.Vinyl name = Field :: "name" ::: String age = Field :: "age" ::: Int type Person = ["name" ::: String, "age" ::: Int] Now suppose I add…
Impredicative
  • 5,039
  • 1
  • 17
  • 43
7
votes
1 answer

Weakening vinyl's RecAll constraint through entailment

In the vinyl library, there is a RecAll type family, which let's us ask that a partially applied constraint is true for every type in a type level list. For example, we can write this: myShowFunc :: RecAll f rs Show => Rec f rs -> String And that's…
6
votes
2 answers

How to use objects list as gulp source stream

I know that gulp require a vinyl source stream to work properly, but is there an easy way to use an already existant vinyl file or a json object instead of the well known gulp.src that only takes globs?
Simon B.Robert
  • 31,754
  • 4
  • 16
  • 24
6
votes
1 answer

Haskell: refer to type of value at compile time

I'm wondering if there's a nice way to refer to types of values without explicitly aliasing them using type in code (not at runtime - there is no reification going on here). Take the following code (using Data.Vinyl): {-# LANGUAGE DataKinds,…
Impredicative
  • 5,039
  • 1
  • 17
  • 43
5
votes
1 answer

Gulp vinyl ftp - Remove local deleted files

I use vinyl ftp to deploy my project on remote server. No problem to upload files but i would also like to delete files that aren't anymore in local folder. Example : Local folder ./ fileA fileB fileC Remote folder : ./ fileB fileC fileD What i…
A. Joahny
  • 301
  • 2
  • 14
4
votes
2 answers

Gulp vinyl ftp - how to use clean function?

The vinyl-ftp package has a function clean() but I'm not sure how to use it right. I need to: get all files from my build folder put them into the target folder on my ftp server clean files if they're not available locally I have the following…
Max Vorozhcov
  • 593
  • 1
  • 6
  • 22
2
votes
1 answer

Clip-path inset circle

I have a squared image and want to cut it middle with a circle shape to see what's behind (actually a body background-image). I found clip-path CSS property, but I only arrive to create a circle with the image instead of creating a circle surrounded…
Navalex
  • 264
  • 2
  • 9
2
votes
1 answer

Pattern synonym binds differently from normal pattern

The function f does not type check in the following code, which uses singletons with Frames and Vinyl: f :: forall rs1 rs2. SList rs1 -> Frame (Record rs1) -> Int f (OnlyRecord s1 t1) df1 = broadcast (*) (rhead <$> df1) pattern OnlyRecord :: Sing…
RichardW
  • 899
  • 10
  • 15
2
votes
1 answer

How to generalize an Opaleye Query in Haskell (Using Vinyl)?

My question is between the huge banners in the code block below. Forgive the code dump, this is all pasted here for anyone wanting to replicate, and this code does work as expected, although it's a bit strange. Notice the last two lines, they print…
Josh.F
  • 3,666
  • 2
  • 27
  • 37
2
votes
2 answers

Gulp Task completes with no error but no file is saved to destination

i am stuck in a kind of a trivial issue and can not get a hang of it. here is the scenario: I am using Gulp Task to convert my html templates to javascript using gulp-html2js My environment is Node v6.9.1, gulp 3.9.1, Windows 7 here is the…
shoaibhb
  • 81
  • 7
2
votes
1 answer

Vinyl: rtraverse with a function requiring a constraint shared by all fields

I have constructed a simple example of a Vinyl record. First, some language pragmas and imports: {-# LANGUAGE DataKinds, TypeOperators #-} import Data.Vinyl import Data.Vinyl.Functor import Control.Applicative the actual example (it employs the…
danidiaz
  • 26,936
  • 4
  • 45
  • 95
2
votes
1 answer

Declare a constraint that holds for Vinyl records having a specific field

I use vinyl to declare a number of different record types, some of which have a field called Content with a specific type LanguageContent. For the functions that depend on the field being present in the record, I want to have a type like: getContent…
Koterpillar
  • 7,883
  • 2
  • 25
  • 41
2
votes
1 answer

Proxies, type level symbols, and JSON

I'm trying to add automagical json parsing to Data.Vinyl Here is an instance for FromJSON for records with exactly one element. It almost works, but I can't satisfy the KnownSymbol constraint, it seems to auto generate a new type variable on…
Theo Belaire
  • 2,980
  • 2
  • 22
  • 33
2
votes
2 answers

Problems with ISubset in vinyl

I have the following code: type Drawable = '["object" ::: Object, "transform" ::: M44 GL.GLfloat] objXfrm :: "transform" ::: M44 GL.GLfloat objXfrm = Field objRec :: "object" ::: Object objRec = Field drawObject :: (Drawable `ISubset` a) => M44…
Dan
  • 12,409
  • 3
  • 50
  • 87
1
vote
0 answers

The `.pipe()` method has deprecated in Gulp/Vinyl, but what it the alternative?

/** * @deprecated This method was removed in v2.0. * If file.contents is a Buffer, it will write it to the stream. * If file.contents is a Stream, it will pipe it to the stream. * If file.contents is null, it will do…
Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
1
2