Anthony G
Anthony G
[Here's an example](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzmYYCmAaOAlNAzYAOzRDUPgF848oIQ4ByPMAWhgGcB6AG2ACNOeAK6EAxjGARCDAFChIsOACo4AQ3ZwAotVr0mrDj36dNwGAAs0UWTOFiJUnXVwFipcgB4AglgBCcNAAPGDIAEw0vAD4AChk4OCh8IhIyGAAuHCS3VO8-SJkASgzo1QyvArgAXkitADpTCysPTUDRbiFQtFy4X0i8xDiEtBghKEI4EorqicTXFPJJuAB+OqhgAHNzGEWMzVrufG3VNQ0Wto6unx7IgoKZChk5cis8VVE0OABhVShEOAB9GAAT3QGQYoh+DAA3HBRBBuNAMuwYGtCOs4A8iCEoK93nAALIQGDQURAtofJCAkFoMEgIkkskHBgYmTA9BwABqaHMwHJVS+PzgAB8CfSoKTyY84YRkXBgOxfO00N9fpUJgA3DJcnnkopwdVyjQqqo1dW1KnsypWxgQ6xwABk9v1tThCNV1oYfCVsmlsqBaG4CIA7sa1ZS2TSbZCsK7EYx-YGIEHmVR1JzubyDlKpLKiHgrIlQgAVakaNUodCxeIJ4MqrCDGjOLLzbbyxVCZU-AoYQZ7ECqMAAGUO0TJJoG8XivvgIFpYolTP5ZPNEbgnE4cA8LBYcHY5ggQm4oTgfA+x1XBeggwo3cKj3XcCDHzhh+Pqm47AgcAAVkJZaJzHfABrOALHlOAhDAUCvwAAzbJUVRgk80CIdYZAfY5IGgbggUfNYYBCcY7HESRxh3J84EA9UPkaXdVFIZBaC9Eh0I3IMN2Odh5AOOU8F3GBVBCdwYEeYA+OiABCeCOxVUcA1rLsCgQQZpzgWdGDpYlxUZNBmTVGskxVFdqTXDctx3PcDyPZC1FAkzLyge4gA) where this can cause unexpected behavior Which is not to say that `fromRefinement` couldn't be useful - just that maybe it should live separately from the existing...
Agreed - good catch! Never mind, I take it all back - I like `fromPredicate`!
@waynevanson do you still want to write a PR for this for version 2.12? It would be very helpful for me personally - I could help out/do it myself if...
I'm running into a small type inference bug w/ the above definition re: `Predicate` (non-`Refinement`) functions - [playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAKjgQwM5wKJwGZQiOAcmzAFoZUB6AG2ACNKNgYALAUykIChRJY4A3nAAKUNgBNgAY2Qw2AGjgAlNtmAA7NiDbqYisMDBs4AXxx4CxMhRr1K2AK7qpMYBHXcu4tlOrIxcFLuqPC4+KIS0rJsAFyCXHBwADwYigCCigBCcGwAHnLq4uhpAHwAFGJqmtq6cSpVWjowSRlwmSWK7gBiyNSosXBlyHEYub4O3i1ZJQCUcAC8JZgzcWUJiShxaetzi5gAdEysHCnT66dwpWVgYpIycnERd9EtHXDdvf2rw5e7SxgrZLZPIFIqXco-TJ-A5HdhQC7tc6pcHXW5RB4iNH3NivTrqHp9AZDLbQgHfEkLf6HZhwi6lLgmLhcSiUOAAOQg8FQDgCAHcWABPOCsYDoUUodQ5KB4KBcILqEJwDTYDi3BZwAxGNaJACMACYAMzydZhEBPdFsbUbMrqaGSpZG9aJG12nZcGZMlltBzwY79FABCAAazlwXgeTAtCkzHVmst631jsSpvN2KtzttlLg9rgSet6ji6gcIDoHFdiQ9HtDCvg6ggaSgAHNY4Z47rDcbkxZU9F04NM3sc3nndCDXqdW6q-LFY2dBxpA3m-MNa2rYnO+Zwlje07+3a4A6N4kpuUC78s+pJ0zp-AINRxABJdQq6USFtahMd9YYfYp7dyPsXQvA9cyPPcL0nIA) Does anyone have an idea why this is happening? Also, is this...
I think I figured it out - w/o type hints, the `onFalse` argument is inferred as `Exclude`, aka `never` Here's a version w/ more robust inference: ```ts declare const fromPredicate:...
Wow amazing work! I learned a ton reading thru that afaict the issue you've highlighted is basically: ```ts declare const literal: '00' | '01' | '10' const ex: O.Option =...
if I understand you correctly, you're deciding between these options: 1) just export the "utility type", leave the function alone: ```ts export type StartsWith = ... export const startsWith: (t:...
> or a more complex type predicate Do you mean something like this? ```ts export const startsWith: { ( s: Start ): ( f: Full ) => f is string...
That's a great point, I had totally missed that, and great idea for a simple fix! I think that requires a change to the type signature as well - here's...
I'm not sure what you mean - how would `Eq.struct` be used with partial fields? Something like this? ```ts import * as Eq from 'fp-ts/Eq' import * as N from...