import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; import { make as Noncard } from "../Noncard.bs"; import { working as NoncardWorking, empty as NoncardEmpty, error as NoncardError } from "./NoncardSupport.bs"; This demonstrates some of the real headaches with Bucklescript interop. In order to make this work as expected, we're going to have to send to Noncard the types it expects. `Noncard` takes lists, which are like Lisp lists in tha they're basically linked lists of two cells, one with content, and one pointing to the next cell in the collection. Internal ReScript typing is a pain in the neck, so if you look, there's a helper file here called `NonscardSupport.res` that Bucklescript compiles into the correct type.
Which means that we can now illustrate the other parts of our code Here's what Noncard shows when we have no words to show:
And here's what it shows in the error state: