Snippets created by Chris Ballard

  • Splitting a sequence based on separator condition

    Whilst working on a google API wrapper, I came across the need to separate a sequence into sub-sequences based on a separator condition. This also led to a requirement for versions of takeWhile and skipWhile which also include the element which first breaks the condition predicate.

    3 people like this

    Posted: 3 years ago by Chris Ballard

  • Convert booleans to bits using fold

    @Samuel - saw your post and thought one part was similar to bit shifting I was playing with yesterday, so rewrote the FromBooleans function using a fold instead of ref cells. Probably not as readable as your version though :)

    2 people like this

    Posted: 3 years ago by Chris Ballard