sifflet 1.2.5.1 → 2.0.0.0
raw patch · 5 files changed
+595/−36 lines, 5 filesdep ~sifflet-lib
Dependency ranges changed: sifflet-lib
Files
- ISSUES +403/−0
- Options.hs +15/−16
- RELEASE-NOTES +159/−0
- sifflet.cabal +6/−8
- sifflet.hs +12/−12
+ ISSUES view
@@ -0,0 +1,403 @@+ISSUES+======++Issues for sifflet and sifflet-lib++This is the ISSUES file for both sifflet and sifflet-lib.+If you are editing it, be sure you are editing the original+and not the copies in the app and lib subdirectories.++O = date opened+R = reporter+P = priority+C = closed++OPEN ISSUES+-----------++41 next issue bug number++40 Duplicate arguments in "Edit Arguments"++ Adding a duplicate argument in the "Edit Arguments" dialog+ is possible (for example, two arguments named "f").+ It should not be.+ O: 2012 July 2+ R: gdw+ P: medium++39 No lambda tool++ There is no lambda tool, and since partial application doesn't work+ (issue 32), this means there is no way to have a function return a function.+ O: 2012 jul 2+ R: gdw+ P: medium++38 Working directory++ Sifflet should have some sense of its working directory, + for convenience of opening and saving files+ O: 2012 july 2+ R: gdw+ P: medium++37 Changing helper function definition does not affect displayed function call++ See f2 and testF2 in ../examples/map.sfl+ When testF2 is called on the workspace, and you edit and chagne f2,+ apply the new definition, the displayed call is not re-evaluated+ using the new definition. In fact if you use the displayed+ testF2 frame to call again, it still uses the old definition --+ it seems permanently bound to it. To use the new definition+ of f2, you have to place a new copy of testF2 on the workspace.++ O: 2012 Jun 27+ R: gdw+ P: low++36 Cascade effect of changing kind of arguments to a function.++ When we change the number of type (kind) of the arguments of+ a function, we also change the function's type (or kind); and if+ it's used in the definitions of other functions, then they may+ become invalid in turn -- what should be done in this case?+ O: 2012 Jun 27+ R: gdw+ P: medium++33 testMapSumFromZero (see ../examples/map.sfl)+ In testMapSumFromZero n, with n = [1,2],+ opening the sumFromZero node displays bogus error messages+ as though it is a call to sumFromZero with n = [1,2].+ In fact, the node has no input, so there is no call + to sumFromZero until we get into map.+ The problem doesn't occur with recursive functions.+ It must be because the node has an inlet that expects n,+ and finds n in the enclosing environment although it is not called.+ O: 2012 June 22+ R: gdw+ P: low++32 Partial application does not work+ (e.g., calling the + function with one argument)+ Comment: See also #39.+ O: 2012 Jun 21+ R: gdw+ P: medium++31 Edit function inputs: when an argument tool is selected,+ and you change the arity of that argument, the next click+ of the tool puts the argument down on the canvas with its+ *old* arity; should be the new arity.+ Comment: A work-around is to reselect the tool to get the right arity.+ O: 2012 Jun 21+ R: gdw+ P: medium++26 EditArgsPanel: TAB fails to move the cursor to the next field.+ O: 2011 Jun 23+ R: gdw+ P: medium-high++25 Nodes lose unused inlets when applying a function definition.+ - Suppose the f node has two inlets, but none of them are+ used by any f nodes in the definition. Then when you apply the+ definition, all the f nodes lose both of their inlets.+ On the other hand, if one f node uses none of its two inlets+ and another uses both, then when you apply the definition,+ both of them keep both of their inlets.+ O: 2011 Jun 23+ R: gdw+ P: lowest.+ Comment:+ This seems not really to be a problem. If NONE of the f nodes+ use their inlets, then why do they have inlets, anyway?+ Besides, it should become irrelevant when a new UI is+ developed without the circular inlets, as in issue 24.+ Comment: The inlets will reappear if you reopen the "inputs"+ dialog and then click "OK".++24 Arguments are shifted when applying a function definition.+ - If a node has 3 inlets and connections on inlets 1 and 2,+ but not on 0, then when "apply" is clicked the connections are+ shifted to inlets 0 and 1, leaving 2 open.+ O: 2011 Jun 23+ R: gdw+ P: lowest.+ This should become irrelevant when and if I develop a new+ UI that does away with the circular inlets. Why not just+ let the user make as many connections as they please? And+ that would get rid of the need for a dialog that lets you+ change the number of inlets too.++23 typeToXml fails for (TypeCons Function)+ O: 2011 Jun 23+ R: gdw+ P: medium++22 When you connect an input to the second (or generally not first)+ input port of a node, and leave the first "open", then click on+ apply, the input is reconnected to the first port instead of the+ second.+ -- Is this actually a bug? + O: 2011 Jun 2+ R: gdw+ P: ???++14 If two frames overlap, then clicks on the top frame+ sometimes are interpreted as clicks on the lower (hidden) frame.+ O: 2010 aug 16+ P: low++13 If you change any of the *example* functions and quit or open,+ Sifflet prompts you to save changes, but it does not save+ these particular changes, since they are not in "My Functions".+ Probably need to re-design the whole organization of examples+ and my functions, introduce modules associated with files,+ and show each in its own panel.+ Opened 2010 May 27.+ Priority: low++11 When function f, which calls function g, is on the workspace,+ and you edit g, the changes do not propagate back to f, so that+ calling f results in calling the *old* g.+ Example: open test-champ.siff, place two-lovely on the workspace,+ call it with any argument, edit lovely, apply, call two-lovely+ again.+ Opened 2010 May 20. + Priority: medium++* * *++CLOSED ISSUES+-------------+++1 After using the literal tool, etc., the program stops responding+ to key presses in the workspace.+ Opened ??+ Closed 2009 Oct 5.++2 Fix resize frame+ Opened ??+ Closed 2009 Oct 13.++3 Quitting (q and File/quit) should actually quit!+ Opened ??+ Closed 2009 Oct 13.++4 vpTypeOf fails for [].+ Opened ??+ Closed 2009 Oct 30.++5 Deleting a node leaves its children orphans.+ Opened ??+ Closed 2009 Nov 4.++6 After closing "My functions" window and re-opening it,+ it should "remembers" the function tools that it had when closed,+ instead of showing up as a blank window.+ Opened ??+ Closed 2009 Nov 11++7 If function pad window is closed, then creating a + new function results in a "key not found" error.+ Opened ??+ Closed 2010 March 1++8 Opening a file twice put duplicate tools in+ "My Functions" window (and toolkit, presumably).+ Opened ??+ Closed 2010 May 13++9 After the dialog suggesting save changes before quitting or+ opening a new file, the program crashes due to a bug in+ Gtk2hs 0.10.0 and 0.10.1 (but fixed in gtk2hs darcs).+ Opened ??+ Closed 2010 May 20.++10 Evaluating a call frame with zero arguments+ opens an unnecessary dialog (there are not arguments,+ so no values needed); moreover, it does not evaluate+ the function call.++15 In the test function list_of_2, evaluating [] results in+ "error: unbound variable: []". Ditto repeat_a_b.+ O: 2010 aug 16+ P: high+ C: 2010 aug 16 -- fixed.++16 Editing a function, if you enter the literal ["a", "b"],+ the program crashes with this message:+ sifflet-new-expr: makeFixedLiteralTool: + non-empty list expression EList [EString "a",EString "b"]+ O: 2010 aug 16+ P: high+ C: 2010 aug 16 -- fixed.+++17 There is an error in reading a non-empty list element from+ a SiffML file, e.g., + <literal>+ <list>+ <string>a</string>+ <string>b</string>+ </list>+ </literal>+ due to the fact that the children of the <list> element+ directly represent values, not expressions, so they are+ not read correctly (not read at all?) by xmlToExpr.+ I think I need to use xmlToValue here, but how to connect+ the two is not easy.+ In the long run, it is desirable to change the XML doctype,+ dropping the <literal> element so that strings would be+ e.g. just <string>a</string>+ and lists would be just e.g. + <list>+ <string>a</string>+ <string>b</string>+ </list>+ O: 2010 aug 17+ P: highest+ C: 2010 aug 17 -- fixed.++19 Closing all program windows leaves executable still running+ but no way to kill it (Ctrl+C is a no-op).*+ O: 2010 nov 3+ R: Andrew Coppin andrewcoppin@btinternet.com+ P: HIGH+ C: 2010 dec 9 (actually fixed dec 3): closing the workspace window+ now "safely" quits from the application.++20 Amend documentation/home page to note that installation on+ Windows without curl is now definitely feasible+ O: 2010 nov 3+ R: Andrew Coppin andrewcoppin@btinternet.com+ P: medium+ C: 2010 dec 9 (actually fixed dec 3)++21 Define adds list =+ if null list+ then 0+ else if head list+ then + list 1+ else tail (head list)+ Call the function with list = [1]+ Sifflet crashes with this error message:+ evalTreeWithLimit (if): unexpected test result+ O: 2010 dec 9+ R: Charles Turner III (turnchan@iue.edu)+ P: high+ C: 2010 dec 9++29 typedValue (in Parser.hs) has two conditions that result in+ run-time errors. For testing higher-order functions, it would+ be good to be able to type in the name of a function in the global+ environment, but we don't have access to the environment here,+ do we? Also in case of failure, it should fail with an error+ message but not crash sifflet.+ O: 2012 Jun 15+ R: gdw+ P: high+ Crashes program.+ C: 2012 June 21 -- fixed.++30 typeToXml: program crashes when saving the map function definition,+ with message:+ sifflet-devel: typeToXml: TypeCons Function cannot be converted to XML.+ Notes: + 1. typeToXml is fixed, but now I also need to fix the corresponding+ part of xmlToType so the file can be read back in.+ 2. Maybe better still:+ Why do we need the types in the XML file anyway, now that+ we have type inference?+ 3. Also revise schema/DTD for SiffML files.+ O: 2012 Jun 21+ R: gdw+ P: highest - program crash+ C: 2012 June 22, fixed.++28 EditArgsPanel should change inlets for existing nodes when the arg's+ kind is changed.+ - Suppose you change the number of parameters for argument f.+ Then any existing f nodes on the drawing should have their+ number of inlets changed correspondingly.+ Currently this works if the number is increased, but+ fails if it is decreased and there are now too many+ connected children in the graph --> error in graphRenderTree.+ Unfortunately, this is not the place where that can be fixed:+ even if I reduce nto or nfrom in this context,+ there are still the contexts in the connected children to+ consider.+ - Also, when extra inputs are disconnected (as they should be)+ they are sometimes also deleted from the canvas (shouldn't be).+ O: 2011 Jun 23+ R: gdw+ P: highest. Crashes program.+ C: 2012 Jun 27, fixed.+++18 Sifflet crashes when applying a function if some connections+ are missing.++ "PS. I presume you know that you can crash the whole of Sifflet by+ something as trivial as hitting the "apply" button when some+ connections are missing, and that closing all of the program windows+ leaves the executable still running but with no way to kill it. (I'm+ not sure why Ctrl+C is no-op...)"+ -- email from Andrew Coppin, 2010 Nov 01.++ O: 2010 nov 3+ R: Andrew Coppin andrewcoppin@btinternet.com+ P: HIGH+ C: 2012 Jun 27 -- unable to duplicate either part of this at this time;+ must have been fixed earlier. Though it might be that the+ "no way to kill it" issue persists on MS Windows.++35 vcCloseFrame does not remove the frame's subgraph from the canvas graph.++ vcCloseFrame removes only the WFrame node, not the WSimple nodes+ displayed in the frame. It should remove all of them, otherwise+ clutter builds up every time a function definition is applied,+ since the apply command calls vcCloseFrame and then vcAddFrame.+ O: 2012 Jun 27+ R: gdw+ P: high+ C: 2012 Jun 27 fixed.++12 Four tests fail in testall -u.+ These seem to all involve issues of text node size+ and are pretty minor, so maybe the tests need to be + fine-tuned to allow for variations in what Cairo says+ is the text's dimensions.+ Opened 2010 May 24+ Priority: medium+ C: 2012 Jul 2, previously fixed but not closed; all unit tests now pass.++34 In edit function / edit arguments: the edit window sometimes+ does not sufficiently increase in size, + so the edit arguments buttons (OK, cancel) + are hidden by the edit function buttons (args, apply, inputs, close).+ Comment: see darcs change:+ Tue Jun 7 12:40:24 EDT 2011 gdweber@iue.edu+ * Crude window resizing to fit as the EditArgsPanel grows+ - crude because it does not take into account the button bar+ below the panel+ Comment: duplicate of #27+ O: 2012 June 26+ R: gdw+ P: top+ C: 2012 jul 2, fixed++27 EditArgsPanel: window resizing is bad.+ - Sometimes the window does not expand enough to show the + panel's buttons.+ - Sometimes it shrinks back too much after the panel is closed.+ - Comment: lib/Graphics/UI/Sifflet/EditArgsPanel.hs+ Workspace.hs : 138+ + O: 2011 Jun 23+ R: gdw+ P: top+ C: 2012 jul 2, fixed
Options.hs view
@@ -14,6 +14,7 @@ , optionsCallFunction :: Maybe String , optionsAdditionalArgs :: [String] , optionsErrorMsg :: Maybe String+ , optionsDebug :: Bool } deriving (Eq, Show) @@ -25,6 +26,7 @@ , optionsCallFunction = Nothing , optionsAdditionalArgs = [] , optionsErrorMsg = Nothing+ , optionsDebug = False } processArgs :: [String] -> Options@@ -43,8 +45,7 @@ [] -> options {optionsErrorMsg = Just "--file: missing file name"} file:args'' ->- processArgsLoop (options {optionsSourceFile = Just file,- optionsShowFunPad = False})+ processArgsLoop (options {optionsSourceFile = Just file}) args'' "--show" -> case args' of@@ -63,6 +64,8 @@ options {optionsCallFunction = Just fname, optionsAdditionalArgs = args'', optionsShowFunPad = False}+ "--debug" ->+ processArgsLoop (options {optionsDebug = True}) args' _ -> options {optionsErrorMsg = Just ("unexpected argument: " ++ arg)}@@ -70,20 +73,16 @@ helpText :: [String] helpText = ["Usage:",- "sifflet [--file SIFFLET-FILE] --show FUNCTION-NAME",- "sifflet [--file SIFFLET-FILE] --call FUNCTION-NAME [ARG ...]",- "sifflet --help",- "sifflet",- "where",- "1. If --file SIFFLET-FILE is given, then the function definition is",- "read from that file; otherwise, it should be one of the Sifflet",- "examples in the Function Pad.",- "2. If --show FUNCTION-NAME is used, the function is merely",- "displayed, ready to be called but not actually called.",- "3. If --call FUNCTION-NAME [ARG ...] is used, the function",- "is displayed and called (with the given arguments ARG ..., if any).",- "4. --help displays this message.",- "Any of these options suppresses the initial appearance of",+ "sifflet [OPTIONS]",+ "",+ "OPTIONS:",+ " --file SIFFLET-FILE : loads SIFFLET-FILE at start.",+ " --show FUNCTION-NAME : displays function FUNCTION-NAME.",+ " --call FUNCTION-NAME [ARG ...] : calls function FUNCTION-NAME " +++ "with given arguments ARG ...",+ " --debug : include context menu items for debugging.",+ " --help : show this message.",+ "The --help, --show, and --call options suppress the initial appearance of", "the Function Pad, though (except with --help) it can still be", "activated by the user."]
+ RELEASE-NOTES view
@@ -0,0 +1,159 @@+% RELEASE NOTES++Release notes for sifflet and sifflet-lib++This is the RELEASE-NOTES file for both sifflet and sifflet-lib.+If you are editing it, be sure you are editing the original+and not the copies in the app and lib subdirectories.++Release 2.0.0.0, 2012 July 5+----------------------------++- Reorganized hierarchical modules to conform to+ http://www.haskell.org/haskellwiki/Hierarchical_module_names+ - Sifflet.Data.X is now Data.Sifflet.X+ for X in [Functoid, Geometry, Tree, TreeGraph,+ TreeLayout, WGraph]+ - Sifflet.Foreign.X is now Language.Sifflet.Export.X+ for X in [Exporter, Haskell, Python, ToHaskell, ToPython, ToScheme]+ - Sifflet.Language.X is now Language.Sifflet.X+ for X in [Expr, Parser, SiffML]+ - Sifflet.Rendering.X is now Graphics.Rendering.Sifflet.X+ for X in [Draw, DrawTreeGraph]+ - Sifflet.Text.X is now Text.Sifflet.X+ for X in [Pretty, Repr]+ - Sifflet.UI.X is now Graphics.UI.Sifflet.X+ for X in [Callback, Canvas, Frame, GtkForeign, GtkUtil, LittleGtk,+ RPanel, Tool, Types, Window, Workspace]+ - Sifflet.UI is now Graphics.UI.Sifflet+ - Sifflet.Util is now Language.Sifflet.Util, and+ Sifflet.Examples is now Language.Sifflet.Examples.+ (not clear that this is really the best place for it;+ maybe it hsould be split into pieces, such as + Control.Monad.SuccFail, ...)+ - Sifflet.Examples is now Language.Sifflet.Examples.++- File menu command to save the image of the Workspace or any+ open editor window, in SVG, PS, or PDF format.++- Implemented type checking with type inference.+ Type inference can be used for export to languages+ that require type declarations.+ Type checking error messages are *not* friendly+ for novice programmers; this needs improvement.++- Editing a function can now change its type.+ - It is now possible to change the arguments of a function+ (add, rename, or remove arguments, or for functional+ arguments, change the kind or arity).++- Bug fixes:+ - Fixed bug where the program crashed from incomplete 'if' trees+ - Various small bug fixes.++- Added RELAX NG schema for siffml version 2.0 (in datafiles).+ This is an upwards-compatible extension of siffml 1.0,+ which adds FunctionType to the alternatives for SiffletType.++- Added RELAX NG schema for siffml version 1.0 (in datafiles)++Release 1.2.5.1, 2012 Jun 14 (or later)+---------------------------------------++- Compatibility with mtl 2.1.1++Release 1.2.5, 2012 Jun 1+-------------------------++- Compatibility with GHC 7.4.1++Release 1.2.4, 2011 Mar 18+--------------------------++- Compatibility with HXT > 9.0++Release 1.2.3, 2011 Feb 18+--------------------------++- Compatibility with GHC 7 and Haskell Platform 2011.2++Release 1.2.2, 2010 Dec 3+-------------------------++- Offers to save changes before quitting++Release 1.2.1, 2010 Nov 19+--------------------------++- Compatibility with Haskell GTK packages 0.12++Release 1.2, 2010 Oct 30+------------------------++- Requires HXT 9.0+- Avoids indirect dependency on curl++Release 1.1, 2010 Aug 24+------------------------++- Improved Haskell exporter now removes most unnecessary+ parentheses.+- Exported Haskell code now uses the module Data.Number.Sifflet,+ formerly Sifflet.Data.Number.+- Sifflet now builds with slightly newer versions of the+ Haskell "Gtk2hs" libraries (cairo, gtk, glib),+ should work for versions >= 0.11.0 and < 0.12.++Release 1.0, 2010 Aug 11+------------------------++- Sifflet now has exporters to Scheme, Python, and Haskell and a small+ supporting "library" for each of those languages.+ This is intended for beginning students who are learning these+ languages, not for "industrial-strength" code production.++- Although the exporters apparently generate correct code,+ there are at present too many parentheses -- a few extra in Python,+ many extra in Haskell; no extra parentheses in Scheme, of course.++- Sifflet has a new number type, Sifflet.Data.Number.Number, which allows+ numbers to be exact or inexact, almost as in Scheme.+ Originally intended for the Scheme exporter, it is now+ also used internally by Sifflet's interpreter.++- The code is reorganized. There is now a separate library package,+ sifflet-lib, in addition to the sifflet package which provides+ only the executable. At present, the library's API is highly+ unstable.++- Sifflet has a new parser for user inputs, made with Parsec, + allowing more intuitive input+ of numbers (liberation from Haskell number syntax:+ for example, 0.0 can now be entered as 0.0, 0., or .0)+ and providing more intelligible error messages+ for some kinds of invalid input.++- Sifflet requires Gtk2hs packages (gtk, glib, cairo) version 0.11;+ support for the 0.10 Gtk2hs packages is dropped.++Release 0.1.7, 2010 June 10+---------------------------++- Tightened upper bounds on package dependency versions, in anticipation of + incompatible changes in the fgl API.+- No bug fixes or new features.+- Users who are staying with fgl == 5.4.2.2 will not benefit from upgrading + to Sifflet 0.1.7.++Release 0.1.6, 2010 May 27+--------------------------++- Sifflet offers to save your work if you give the quit or + open file command and have unsaved changes.+- Sifflet now builds with Gtk2hs 0.11.+- Some bug fixes and improved error checking.++Release 0.1.5, 2010 May 13+--------------------------++First public release.
sifflet.cabal view
@@ -1,5 +1,5 @@ name: sifflet-version: 1.2.5.1+version: 2.0.0.0 cabal-version: >= 1.8 build-type: Simple license: BSD3@@ -17,19 +17,17 @@ Sifflet show the intermediate steps of the computation on the diagram, and can expand function calls to show further details. It is intended as an aid for learning about recursion.- Version 1.2.5: Compatibility with GHC 7.4.1.- Version 1.2.4: Dependencies revised for compatibility with HXT 9.1.- Version 1.2.3: Dependencies revised for compatibility with GHC 7.0- and Haskell Platform 2011.2.+ Version 2.0.0.0 adds partial support for higher-order functions, like map + and filter. category: Language , Visual Programming-tested-with: GHC == 7.4.1+tested-with: GHC == 7.4.2 -- data-files: filename list -- data-dir: directory -- extra-tmp-files: filename list -extra-source-files: README+extra-source-files: README ISSUES RELEASE-NOTES flag no-link description: Inhibit linking; just compile.@@ -50,7 +48,7 @@ hxt >= 9 && < 10.0, mtl >= 1.1 && < 2.2, process >= 1.0 && < 1.2,- sifflet-lib >= 1.2.3+ sifflet-lib >= 2.0 && < 2.1 if !os(windows) build-depends: unix >= 2.3 && < 2.6
sifflet.hs view
@@ -4,13 +4,13 @@ import Data.IORef import System.Exit -import Sifflet.Data.Functoid-import Sifflet.Data.TreeLayout-import Sifflet.Examples-import Sifflet.Language.Expr-import Sifflet.Language.Parser-import Sifflet.UI-import Sifflet.Util+import Data.Sifflet.Functoid+import Data.Sifflet.TreeLayout+import Language.Sifflet.Examples+import Language.Sifflet.Expr+import Language.Sifflet.Parser+import Graphics.UI.Sifflet+import Language.Sifflet.Util import Options @@ -29,10 +29,10 @@ ; let commands = processArgs args -- create the user interface- ; vpui <- vpuiNew wstyle initialEnv+ ; vpui <- vpuiNew wstyle initialEnv (optionsDebug commands) ; let vpui' = vpui {vpuiToolkits = defaultVPUIToolkitsWithExamples} ; uiref <- newIORef vpui'- -- Create wome windows+ -- Create some windows ; let cbmgr = mkCBMgr uiref ; vpui'' <- showWorkWin vpui' workspaceId cbmgr ; writeIORef uiref vpui''@@ -65,7 +65,7 @@ -- Return an exit code if processing should continue. performCommands :: Options -> CBMgr -> IORef VPUI -> IO (Maybe ExitCode)-performCommands options cbmgr uiref =+performCommands options cbmgr uiref = -- Error? case optionsErrorMsg options of Just msg ->@@ -78,14 +78,14 @@ { -- show function pad? when (optionsShowFunPad options)- (modifyIORefIO uiref (showFunctionPadWindow cbmgr))+ (modifyIORefIO (showFunctionPadWindow cbmgr) uiref) -- source a file? -- What if no such file??? ; case optionsSourceFile options of Nothing -> return () Just file ->- modifyIORefIO uiref (openFilePath cbmgr file)+ modifyIORefIO (openFilePath cbmgr file) uiref -- show or call a function? ; case (optionsShowFunction options,