Strange bug: Could not open editor...

Help
2011-08-13
2012-12-06
  • Stef Joosten
    Stef Joosten
    2011-08-13

    Yesterday, Eclipse fell over a bug, which I could not resolve.

    I work with a project of 70 Haskell modules. Most of them can be handled excellently by Eclipse, formidably and beautifully supported by EclipseFP (Thank you!). This one file, called ShowHS.hs, however, will not open at all. I get the message: "Could not open the editor: Argument not valid" from org.eclipse.ui. Symptoms are:
    - I have opened and worked with this file before, so something must have changed to cause this.
    - The file itself opens in another editor, and I can make and save changes. After saving these changes, Eclipse still refuses to open the file. So it seems that the file is OK.
    - I have reloaded the entire project from the SVN server without deleting contents. This had no noticeable effect.
    - I have reloaded the entire project from the SVN server with deleting contents. This resolved the problem, albeit in a brute manner.
    -After reloading, when building the workspace, the error log gets many messages "Possibly stalled queue " from net.sf.eclipsefp.haskell.scion.client
    - I have put the error log message below, at the end of this report.
    My acute problem is solved (I can open the file), but I still wanted to report this bug.

    eclipse.buildId=I20110613-1736
    java.version=1.7.0
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=nl_NL
    Command-line arguments:  -os win32 -ws win32 -arch x86_64

    Error
    Sat Aug 13 06:58:29 CEST 2011
    Unable to create editor ID net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor: Argument not valid

    java.lang.IllegalArgumentException: Argument not valid
    at org.eclipse.swt.SWT.error(SWT.java:4263)
    at org.eclipse.swt.SWT.error(SWT.java:4197)
    at org.eclipse.swt.SWT.error(SWT.java:4168)
    at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9680)
    at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9774)
    at org.eclipse.jface.text.TextViewer.applyTextPresentation(TextViewer.java:4836)
    at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4888)
    at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
    at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
    at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
    at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.inputDocumentChanged(PresentationReconciler.java:119)
    at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2888)
    at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2937)
    at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:636)
    at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:376)
    at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:584)
    at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:4030)
    at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3558)
    at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
    at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
    at net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor.createPartControl(HaskellEditor.java:309)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
    at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
    at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
    at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
    at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
    at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
    at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
    at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
    at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
    at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
    at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
    at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
    at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
    at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
    at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:1109)
    at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openMarkerInEditor(ExtendedMarkersView.java:1719)
    at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openSelectedMarkers(ExtendedMarkersView.java:1188)
    at org.eclipse.ui.internal.views.markers.ExtendedMarkersView$5.open(ExtendedMarkersView.java:578)
    at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

     
  • JP Moresmau
    JP Moresmau
    2011-08-13

    I've seen that error, mainly in one case: you have tabs instead of spaces somewhere in your file. It used to not matter, but GHC 7 changed the way it reports locations when it encountered tabs, which throws of counter the eclipse tokens for syntax highlighting. The github version has a detection mecahnism for that and will replace all tabs by space when you open the file (after prompting you). Try to replace all tabs by spaces and see if it fixes the problem.

     
  • Han Joosten
    Han Joosten
    2011-08-13

    I had the same bug too. It was caused by tabs indeed. After I replaced the tabs for spaces, It was ok.
    There is a preference setting in eclipse to replace tabs with spaces. Make sure you have it checked. Also, be careful when you use block mode.
    It might help to show whitespace characters: Preferences > General > Editors > Text Editors : Check 'show whitespace characters'.

     

  • Anonymous
    2011-11-28

    I'm suddenly having the same problem with 2 of my 4 haskell files (very small project). I say "suddenly" because they all worked fine some time ago. Also, the newest (almost empty) haskell file opens fine.

    Error:

    java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:4263)
        at org.eclipse.swt.SWT.error(SWT.java:4197)
        at org.eclipse.swt.SWT.error(SWT.java:4168)
        at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9680)
        at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9774)
        at org.eclipse.jface.text.TextViewer.applyTextPresentation(TextViewer.java:4836)
        at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4888)
        at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
        at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
        at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
        at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.inputDocumentChanged(PresentationReconciler.java:119)
        at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2888)
        at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2937)
        at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:640)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:376)
        at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:588)
        at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:4030)
        at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3558)
        at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
        at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
        at net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor.createPartControl(HaskellEditor.java:323)
        at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
        at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
        at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
        at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
        at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
        at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
        at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
        at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
        at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
        at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
        at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
        at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
        at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
        at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
        at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
        at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
        at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
        at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:355)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
        at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50)
        at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
        at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)
        at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
        at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
        at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
        at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
        at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
        at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
        at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
        at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    

    I have the latest EclipseFP/Eclipse and Java 7.

    I don't have any tabs in the two files, I checked both with Eclipse's text editor and Notepad2 (searching for \t).

     

  • Anonymous
    2011-11-28

    Also, there's an additional warning that occurs just after I start Eclipse:

    eclipse.buildId=M20110909-1335
    java.version=1.7.0_02-ea
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments:  -product org.eclipse.epp.package.java.product
    Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
    This is a continuation of log file E:\_\Haskell\.metadata\.bak_0.log
    Created Time: 2011-11-28 12:06:58.049
    Warning
    Mon Nov 28 12:06:58 CET 2011
    Ignored attempt to add saveable that was already registered
    org.eclipse.core.runtime.AssertionFailedException: unknown saveable: org.eclipse.ui.internal.DefaultSaveable@4549921b from part: org.eclipse.ui.internal.ErrorEditorPart@4549921b
        at org.eclipse.ui.internal.SaveablesList.logWarning(SaveablesList.java:187)
        at org.eclipse.ui.internal.SaveablesList.addModel(SaveablesList.java:117)
        at org.eclipse.ui.internal.SaveablesList.addModels(SaveablesList.java:289)
        at org.eclipse.ui.internal.SaveablesList.postOpen(SaveablesList.java:695)
        at org.eclipse.ui.internal.PartList.partOpened(PartList.java:234)
        at org.eclipse.ui.internal.PartList.access$0(PartList.java:210)
        at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList.java:40)
        at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:375)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:610)
        at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
        at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
        at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:355)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
        at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50)
        at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
        at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)
        at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
        at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
        at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
        at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
        at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
        at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
        at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
        at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    

    .. and an error:

    eclipse.buildId=M20110909-1335
    java.version=1.7.0_02-ea
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments:  -product org.eclipse.epp.package.java.product
    Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
    This is a continuation of log file E:\_\Haskell\.metadata\.bak_0.log
    Created Time: 2011-11-28 12:06:58.049
    Error
    Mon Nov 28 12:07:51 CET 2011
    Unhandled event loop exception
    java.lang.AssertionError: Expecting text editor. Found:org.eclipse.ui.internal.ErrorEditorPart
        at net.sf.eclipsefp.haskell.ui.internal.editors.haskell.actions.AbstractAction.getTextEditor(AbstractAction.java:47)
        at net.sf.eclipsefp.haskell.ui.internal.editors.haskell.actions.FirstCharAction.run(FirstCharAction.java:23)
        at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
        at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1455)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
        at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1809)
        at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4892)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4560)
        at org.eclipse.swt.widgets.Text.windowProc(Text.java:2254)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    
     
  • JP Moresmau
    JP Moresmau
    2011-12-09

    A new problem was found that can cause the dreaded Argument not valid error when opening the editor. The fix will be part of the 0.2.2 release of buildwrapper. It occurs when you have contiguous preprocessor directives. Just insert a blank line between them…

     

  • Anonymous
    2011-12-14

    I just reinstalled EclipseFP completely and I still have the same bug.

    Here's an example of a file that doesn't exhibit the bug:

    import Data.Char
    import Data.List
    -- Sandro Gržičić, 0036438748
    -- Haskell FER DZ05
    -- 2011-12
    -- === PUH-LEKCIJA-7 =================================================================
    -- === PUH-LEKCIJA-8 =================================================================
    -- === DZ ============================================================================
    

    (This is a homework assignment, I'm still learning Haskell.)

    Here's one that does:

    import Prelude hiding (elem)
    import Data.Char
    import Data.List hiding (delete, elem)
    -- Sandro Gržičić, 0036438748
    -- Haskell FER DZ04
    -- 2011-11
    -- === PUH-LEKCIJA-6 =================================================================
    -- 1.1
    product' :: Num a => [a] -> a
    product' [] = 1
    product' (x:xs) = x * product' xs
    -- 1.2
    headsOf [] = []
    headsOf (a:b) = (head a) : headsOf b
    -- 2.1
    productMod :: Int -> Int -> [Int] -> [Int]
    productMod n m [] = []
    productMod n m (a:b) = (a * n) `mod` m : productMod n m b
    -- 2.2
    addPredecessor xs = add 0 xs
      where add _ [] = [] 
            add n (x:xs) = n + x : add x xs
    -- 3.1
    equalTriplets :: Eq a => [(a,a,a)] -> [(a,a,a)] 
    equalTriplets [] = []
    equalTriplets ((x@(a,b,c)):xs)
      | a == b && b == c = x : equalTriplets xs 
      | otherwise = equalTriplets xs
    -- 3.2
    replicate' :: Int -> a -> [a]
    replicate' n a 
      | n > 1 = [a] ++ replicate (n-1) a
      | n == 1 = [a]
      | n < 1 = error "n mora biti > 0!"
    -- 4.1
    drop' :: Int -> [a] -> [a]
    drop' n xs@(a:b)
      | abs n >= length xs = error "|n| mora biti < duljine liste!"
      | n == 0 = xs
      | n > 0 = drop' (n-1) b
      | n < 0 = reverse $ drop' (-n) (reverse xs)
    -- 4.2
    takeFromTo :: Int -> Int -> [a] -> [a]
    takeFromTo _ _ [] = []
    takeFromTo 0 0 xs = []
    takeFromTo 0 n2 (x:xs) = x : takeFromTo 0 (n2 - 1) xs
    takeFromTo n1 n2 (x:xs) = takeFromTo (n1 - 1) (n2 - 1) xs 
    -- 5.1
    eachThird :: [a] -> [a]
    eachThird [] = []
    eachThird xs = eachThird' 2 xs
      where
         eachThird' n [] = [] 
         eachThird' n (x:xs) 
             | n == 0 = x : eachThird' 2 xs
             | otherwise = eachThird' (n-1) xs
    -- 5.2
    crossZip :: [a] -> [b] -> [(a,b)]
    crossZip [xs] [ys] = []
    crossZip [xs] _ = []
    crossZip _ [ys] = []
    crossZip (x1:x2:xs) (y1:y2:ys) = (x1,y2) : (x2,y1) : crossZip (x2:xs) (y2:ys)
    -- 6.1
    length' :: [a] -> Int
    length' [] = 0
    length' xs = length'' 0 xs
      where
        length'' n [] = n
        length'' n (_:xs) = length'' (n+1) xs   
    -- 6.2
    maxUnzip :: [(Int,Int)] -> (Int,Int)
    maxUnzip [] = error "empty list"
    maxUnzip pairs = maxUnzip' (xs !! 0) (ys !! 0) xs ys
      where
        (xs, ys) = unzip pairs 
        maxUnzip' xMax yMax [] [] = (xMax, yMax)
        maxUnzip' xMax yMax (x:xs) [] = (xMax, yMax)
        maxUnzip' xMax yMax [] (y:ys) = (xMax, yMax)
        maxUnzip' xMax yMax (x:xs) (y:ys)
          | x > xMax && y > yMax = maxUnzip' x y xs ys  
          | x > xMax = maxUnzip' x yMax xs ys
          | y > yMax = maxUnzip' xMax y xs ys
          | otherwise = maxUnzip' xMax yMax xs ys
    -- bez akumulatora
    maxUnzipR :: [(Int,Int)] -> (Int,Int)
    maxUnzipR [] = error "empty list"
    maxUnzipR pairs = maxUnzipR' xs ys
      where
        (xs, ys) = unzip pairs
        firstX = xs !! 0
        firstY = ys !! 0
        maxUnzipR' [] [] = (firstX, firstY)
        maxUnzipR' (x:xs) [] = (x, firstY)
        maxUnzipR' [] (y:ys) = (firstX, y)
        maxUnzipR' (x:xs) (y:ys)
          | x > xMax && y > yMax = (x, y)   
          | x > xMax = (x, yMax) 
          | y > yMax = (xMax, y) 
          | otherwise = (xMax, yMax)
          where (xMax, yMax) = maxUnzipR' xs ys  
    -- === DZ ============================================================
    -- 2.
    -- izravna rekurzija
    sumEven :: Num a => [a] -> a
    sumEven [] = 0
    sumEven (x:xs) = x + skipOdd xs
      where 
        skipOdd [] = 0
        skipOdd (x:xs) = sumEven xs
    -- akumulator  
    sumEven' :: Num a => [a] -> a
    sumEven' [] = 0
    sumEven' (x:xs) = skipOdd x xs
      where
        sumEven'' a [] = a
        sumEven'' a (x:xs) = skipOdd (a+x) xs
        skipOdd a [] = a
        skipOdd a (x:xs) = sumEven'' a xs
    -- 3.
    -- napomena: funkcija radi i sa negativnim indeksima (u tom slučaju kreće od kraja liste prema početku)
    (!) :: [a] -> Int -> [a]
    (!) [] n = []
    (!) [x] _ = [x]
    (!) (x:xs) 0 = [x]
    (!) l@(x:xs) n
      | n < 0 = reverse $ el (reverse l) ((abs n)-1) -- funkcija radi i za negativne indekse ^^
      | n >= length l = [] -- provjerimo samo jednom (O(n)) je li n ispravan
      | otherwise = el xs (n-1) -- n je ispravan, ne provjeravamo ga više
      where
        el [x] _ = [x]
        el (x:xs) 0 = [x]
        el (x:xs) n = el xs (n-1) 
    -- napomena: funkcija radi i sa negativnim indeksima (u tom slučaju kreće od kraja liste prema početku)
    (!!!) :: [a] -> [Int] -> [a]
    (!!!) [] _ = [] 
    (!!!) _ [] = []
    (!!!) l (i:is) = head (l ! i) : (l !!! is)
    
    delete :: Eq a => a -> [a] -> [a]
    delete _ [] = []
    delete e l = delete' [] l
      where
        delete' h [] = h
        delete' h t@(x:t')
          | e == x = h ++ t'                  -- vrati glavu i rep bez obrisanog elementa
          | otherwise = delete' (h ++ [x]) t' -- inače nastavi tražiti element     
    deleteEach :: Eq a => a -> [a] -> [a]
    deleteEach _ [] = []
    deleteEach e l = deleteEach' [] l
      where
        deleteEach' h [] = h 
        deleteEach' h t@(x:t')
          | e == x = deleteEach' h t'                        
          | otherwise = deleteEach' (h ++ [x]) t'
    
    insertAt :: Int -> a -> [a] -> [a]
    insertAt _ _ [] = []
    insertAt i e l
      | i < 0 || i > length l = l
      | otherwise = insertAt' i [] l
      where
        insertAt' 0 h [] = h ++ [e]
        insertAt' 0 h t = h ++ [e] ++ t
        insertAt' i h t@(x:t') = insertAt' (i-1) (h ++ [x]) t'  
          
    elem :: Eq a => a -> [a] -> Bool
    elem _ [] = False
    elem e (x:xs)
      | e == x = True
      | otherwise = elem e xs 
      
    prefixOf :: Eq a => [a] -> [a] -> Bool
    prefixOf [] _ = True
    prefixOf _ [] = False
    prefixOf [x] (y:_) = x == y
    prefixOf (x:xs) (y:ys) = x == y && prefixOf xs ys  
        
    substringOf :: Eq a => [a] -> [a] -> Bool
    substringOf [] _ = True
    substringOf _ [] = False
    substringOf [x] (y:ys) = x == y || substringOf [x] ys 
    substringOf l@(x:xs) (y:ys) = (x == y && substringOfSeq xs ys) || substringOf l ys
      where
        substringOfSeq [x] (y:_) = x == y
        substringOfSeq (x:xs) (y:ys) = x == y && substringOfSeq xs ys
        substringOfSeq _ _ = False
    -- 4.    
    nubRight :: Eq a => [a] -> [a]
    nubRight [] = []
    nubRight l = nubRight' [] l -- volim akumulatore :D (+ u Scali je akumulatorsko rješenje drastično bolje ^^)
      where
        nubRight' h [] = h
        nubRight' h t@(x:t') = nubRight' (h ++ [x]) (deleteEach x t')
    nubLeft :: Eq a => [a] -> [a]
    nubLeft [] = []
    nubLeft l = reverse $ nubRight $ reverse l 
        
    -- 5.
    median :: (Integral a, Fractional b) => [a] -> b
    median [] = error "prazna lista"
    median l = median' (ceiling ((fromIntegral len - 2) / 2)) l
      where
        len = length l    
        median' 0 (x:xs)
          | (len `mod` 2) == 1 = realToFrac x
          | otherwise = ((realToFrac x) + (realToFrac $ head xs)) / 2 
        median' n (x:xs) = median' (n - 1) xs
       
    -- 6.
    rank1223 :: Eq a => [a] -> [(a, Int)]
    rank1223 [] = []
    rank1223 l = rank1223a [] 1 l 
      where
        rank1223a a _ []  = a
        rank1223a a n [x] = a ++ [(x, n)]
        rank1223a a n (x:xs) 
          | x == head xs = rank1223a (a ++ [(x, n)]) n xs
          | otherwise = rank1223a (a ++ [(x, n)]) (n + 1) xs
         
    rank1224 :: Eq a => [a] -> [(a, Int)]
    rank1224 [] = []
    rank1224 l = rank1224a [] 1 0 l 
      where
        rank1224a a _ _ [] = a
        rank1224a a n nDelta [x] = a ++ [(x, (n + nDelta))]
        rank1224a a n nDelta (x:xs) 
          | x == head xs = rank1224a' (a ++ [(x, n)]) n (nDelta + 1) xs
          | otherwise = rank1224a (a ++ [(x, n + nDelta)]) (n + nDelta + 1) 0 xs
            where -- slučaj kada je idući element jednak prethodnom; moramo paziti na zadnji jednaki element  
              rank1224a' a _ _ []  = a
              rank1224a' a n _ [x] = a ++ [(x, n)]
              rank1224a' a n nDelta (x:xs) 
                | x == head xs = rank1224a' (a ++ [(x, n)]) n (nDelta + 1) xs
                | otherwise = rank1224a (a ++ [(x, n)]) (n + nDelta + 1) 0 xs
              
    -- 7.
    -- baš je lijepo ispala funkcija :)
    guidedMerge :: [a] -> [a] -> [Int] -> [a]
    guidedMerge [] [] _  = []
    guidedMerge _  _  [] = []
    guidedMerge xs ys ns = gMerge [] xs ys ns     
      where
        gMerge a _  _  []     = a
        gMerge a [] [] _      = a
        gMerge a [] ys (n:ns) = gMerge a ys [] ns
        gMerge a xs ys (0:ns) = gMerge a ys xs ns
        gMerge a (x:xs) ys (n:ns)
          | n > 0 = gMerge (a ++ [x]) xs ys ((n-1):ns) 
          | n < 0 = gMerge a xs ys ((n+1):ns)
    -- 8.
    breakAt :: (Eq a) => a -> [a] -> ([a], [a])
    breakAt delim l = breakAt' [] l
      where
        breakAt' h [] = (h, []) 
        breakAt' h t@(x:t')
          | delim == x = (h, t')
          | otherwise = breakAt' (h ++ [x]) t' 
    splitOn :: (Eq a) => a -> [a] -> [[a]]
    splitOn delim l = splitOn' [] (breakAt delim l)
      where
        splitOn' a (h, []) = a ++ [h]
        splitOn' a (h, t) = splitOn' (a ++ [h]) $ breakAt delim t  
    -- 9.
    align :: Ord a => a -> [a] -> [a] -> ([a], [a])
    align separator xs ys = alignA [] [] xs ys
      where
        sep = [separator]
        alignA ax ay [] _ = (ax, ay)
        alignA ax ay _ [] = (ax, ay)
        alignA ax ay lx@(x:xs) ly@(y:ys)
          | x == y    = alignA (ax ++ [x]) (ay ++ [y]) xs ys
          | x <  y    = alignA (ax ++ [x]) (ay ++ sep) xs ly
          | otherwise = alignA (ax ++ sep) (ay ++ [y]) lx ys    
    align' :: Ord a => a -> [a] -> [a] -> ([a],[a])
    align' separator xs ys = alignA' [] [] xs ys
      where
        sep = [separator]
        alignA' ax ay []     []     = (ax, ay)
        alignA' ax ay []     (y:ys) = alignA' (ax ++ sep) (ay ++ [y]) [] ys -- razlika u odnosu na alignA
        alignA' ax ay (x:xs) []     = alignA' (ax ++ [x]) (ay ++ sep) xs [] -- razlika u odnosu na alignA 
        alignA' ax ay lx@(x:xs) ly@(y:ys)
          | x == y    = alignA' (ax ++ [x]) (ay ++ [y]) xs ys
          | x <  y    = alignA' (ax ++ [x]) (ay ++ sep) xs ly
          | otherwise = alignA' (ax ++ sep) (ay ++ [y]) lx ys    
    -- 10.
    mergeSort3 :: Ord a => [a] -> [a]
    mergeSort3 [] = []
    mergeSort3 [x] = [x] 
    mergeSort3 l = merge3 (mergeSort3 xs) (mergeSort3 ys) (mergeSort3 zs) 
      where (xs, ys, zs) = split3 l
    split3 :: [a] -> ([a], [a], [a])
    split3 xs = split3' [] [] [] xs
      where
        split3' ax ay az []        = (ax, ay, az)
        split3' ax ay az (x:y:z:r) = split3' (ax ++ [x]) (ay ++ [y]) (az ++ [z]) r
        split3' ax ay az [x, y]    = split3' (ax ++ [x]) (ay ++ [y]) az          []
        split3' ax ay az [x]       = split3' (ax ++ [x]) ay          az          []
    merge3 :: Ord a => [a] -> [a] -> [a] -> [a]
    merge3 xs ys zs = merge3' [] xs ys zs
      where
        merge3' a [] [] []                       = a
        
        merge3' a (x:xs) [] []                   = merge3' (a ++ [x]) xs [] [] 
        merge3' a []     ly@(y:ys) []            = merge3' a ly [] [] 
        merge3' a []     []        lz@(z:zs)     = merge3' a lz [] []
        
        merge3' a lx@(x:xs) ly@(y:ys) []
          | x < y                                = merge3' (a ++ [x]) xs ly []                     
          | otherwise                            = merge3' (a ++ [y]) lx ys []
        merge3' a []        ly@(y:ys) lz@(z:zs)  = merge3' a ly lz [] 
        merge3' a lx@(x:xs) []        lz@(z:zs)  = merge3' a lx lz []
        
        merge3' a lx@(x:xs) ly@(y:ys) lz@(z:zs)
          | x < y && y < z || x < z && z < y     = merge3' (a ++ [x]) xs ly lz                     
          | y < z                                = merge3' (a ++ [y]) lx ys lz
          | otherwise                            = merge3' (a ++ [z]) lx ly zs
    
     

  • Anonymous
    2011-12-14

    Hmm, the ** in 5.2 triggered the bold bbcode for some reason, even though it was in the code tag. So on line 72, the line goes:

    **

    crossZip :: [a] -> [ b ] -> [(a,b)]
    


    (surrounded b with spaces.)

     

  • Anonymous
    2011-12-14

    Ok, I'm an idiot.

    And I absolutely LOVE a forum without an edit button. *shrugs*

     
  • JP Moresmau
    JP Moresmau
    2011-12-20

    Ok your issue is because of the non ascii characters. Buildwrapper forgot to use UTF8 to read and write files, and so it throws the lexer off balance. Will be fixed in buildwrapper 0.2.2.